remove Convert pointer from PVField

Allow inline construction of Convert
This commit is contained in:
Michael Davidsaver
2013-05-08 10:31:36 -04:00
parent 9e8a6b6304
commit 461dbdf0f8
4 changed files with 3 additions and 15 deletions

View File

@@ -43,13 +43,6 @@ static std::vector<String> split(String commaSeparatedList) {
}
return valueList;
}
Convert::Convert()
{}
Convert::~Convert(){}
void Convert::getString(StringBuilder buf,PVField const *pvField,int indentLevel)
{

View File

@@ -26,8 +26,7 @@ PVField::PVField(FieldConstPtr field)
: notImplemented("not implemented"),
parent(NULL),field(field),
fieldOffset(0), nextFieldOffset(0),
immutable(false),
convert(getConvert())
immutable(false)
{
}
@@ -175,7 +174,7 @@ void PVField::setParentAndName(PVStructure * xxx,String const & name)
bool PVField::equals(PVField &pv)
{
return convert->equals(*this,pv);
return pv==*this;
}
void PVField::toString(StringBuilder buf)
@@ -185,7 +184,7 @@ void PVField::toString(StringBuilder buf)
void PVField::toString(StringBuilder buf,int indentLevel)
{
convert->getString(buf,this,indentLevel);
Convert().getString(buf,this,indentLevel);
if(pvAuxInfo.get()!=NULL) pvAuxInfo->toString(buf,indentLevel);
}

View File

@@ -71,7 +71,6 @@ typedef std::tr1::shared_ptr<Convert> ConvertPtr;
class Convert {
public:
static ConvertPtr getConvert();
~Convert();
/**
* Get the full fieldName for the pvField.
* @param builder The builder that will have the result.
@@ -817,8 +816,6 @@ public:
* @param indentLevel Indent level, Each level is four spaces.
*/
void newLine(StringBuilder buf, int indentLevel);
private:
Convert();
};
static inline ConvertPtr getConvert() { return Convert::getConvert(); }

View File

@@ -373,7 +373,6 @@ private:
bool immutable;
RequesterPtr requester;
PostHandlerPtr postHandler;
std::tr1::shared_ptr<class Convert> convert;
friend class PVDataCreate;
friend class PVStructure;
};