lots of minor changes
This commit is contained in:
@@ -43,10 +43,7 @@ public:
|
||||
|
||||
PvaClientPutDataPtr PvaClientPutData::create(StructureConstPtr const & structure)
|
||||
{
|
||||
if(PvaClient::getDebug()) {
|
||||
cout << "PvaClientPutData::create"
|
||||
<< endl;
|
||||
}
|
||||
if(PvaClient::getDebug()) cout << "PvaClientPutData::create\n";
|
||||
PvaClientPutDataPtr epv(new PvaClientPutData(structure));
|
||||
return epv;
|
||||
}
|
||||
@@ -54,6 +51,7 @@ PvaClientPutDataPtr PvaClientPutData::create(StructureConstPtr const & structure
|
||||
PvaClientPutData::PvaClientPutData(StructureConstPtr const & structure)
|
||||
: PvaClientData(structure)
|
||||
{
|
||||
if(PvaClient::getDebug()) cout << "PvaClientPutData::PvaClientPutData\n";
|
||||
PVStructurePtr pvStructure(getPVDataCreate()->createPVStructure(structure));
|
||||
BitSetPtr bitSet(BitSetPtr(new BitSet(pvStructure->getNumberFields())));
|
||||
setData(pvStructure,bitSet);
|
||||
@@ -75,6 +73,7 @@ PvaClientPutData::PvaClientPutData(StructureConstPtr const & structure)
|
||||
|
||||
void PvaClientPutData::putDouble(double value)
|
||||
{
|
||||
if(PvaClient::getDebug()) cout << "PvaClientPutData::putDouble\n";
|
||||
PVScalarPtr pvScalar = getScalarValue();
|
||||
ScalarType scalarType = pvScalar->getScalar()->getScalarType();
|
||||
if(scalarType==pvDouble) {
|
||||
@@ -90,34 +89,43 @@ void PvaClientPutData::putDouble(double value)
|
||||
|
||||
void PvaClientPutData::putString(std::string const & value)
|
||||
{
|
||||
if(PvaClient::getDebug()) cout << "PvaClientPutData::putString\n";
|
||||
PVScalarPtr pvScalar = getScalarValue();
|
||||
convert->fromString(pvScalar,value);
|
||||
}
|
||||
|
||||
void PvaClientPutData::putDoubleArray(shared_vector<const double> const & value)
|
||||
{
|
||||
if(PvaClient::getDebug()) cout << "PvaClientPutData::putDoubleArray\n";
|
||||
PVScalarArrayPtr pvScalarArray = getScalarArrayValue();
|
||||
if(pvScalarArray->getScalarArray()->getElementType()!=pvDouble) {
|
||||
throw std::runtime_error(messagePrefix + notDoubleArray);
|
||||
}
|
||||
PVDoubleArrayPtr pv = static_pointer_cast<PVDoubleArray>(pvScalarArray);
|
||||
if(!pv) throw std::runtime_error(messagePrefix + notDoubleArray);
|
||||
pv->replace(value);
|
||||
}
|
||||
|
||||
void PvaClientPutData::putStringArray(shared_vector<const std::string> const & value)
|
||||
{
|
||||
if(PvaClient::getDebug()) cout << "PvaClientPutData::putStringArray\n";
|
||||
PVScalarArrayPtr pvScalarArray = getScalarArrayValue();
|
||||
if(pvScalarArray->getScalarArray()->getElementType()!=pvString) {
|
||||
throw std::runtime_error(messagePrefix + notStringArray);
|
||||
}
|
||||
PVStringArrayPtr pv = static_pointer_cast<PVStringArray>(pvScalarArray);
|
||||
if(!pv) throw std::runtime_error(messagePrefix + notStringArray);
|
||||
pv->replace(value);
|
||||
}
|
||||
|
||||
void PvaClientPutData::putStringArray(std::vector<std::string> const & value)
|
||||
{
|
||||
if(PvaClient::getDebug()) cout << "PvaClientPutData::putStringArray\n";
|
||||
PVScalarArrayPtr pvScalarArray = getScalarArrayValue();
|
||||
convert->fromStringArray(pvScalarArray,0,value.size(),value,0);
|
||||
}
|
||||
|
||||
void PvaClientPutData::postPut(size_t fieldNumber)
|
||||
{
|
||||
if(PvaClient::getDebug()) cout << "PvaClientPutData::postPut\n";
|
||||
getChangedBitSet()->set(fieldNumber);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user