21 #define epicsExportSharedSymbols 34 namespace epics {
namespace pvData {
41 std::ostringstream key;
45 unsigned H =
epicsStrHash(key.str().c_str(), 0xbadc0de1);
52 template<
typename FLD>
56 Lock G(create->mutex);
59 std::pair<cache_t::iterator, cache_t::iterator> itp(create->cache.equal_range(hash));
60 for(; itp.first!=itp.second; ++itp.first) {
61 Field* cent(itp.first->second);
62 FLD* centx(dynamic_cast<FLD*>(cent));
63 if(centx &&
compare(*centx, *ent)) {
67 }
catch(std::tr1::bad_weak_ptr&){
76 create->cache.insert(std::make_pair(hash, ent.get()));
96 Lock G(create->mutex);
98 std::pair<FieldCreate::cache_t::iterator, FieldCreate::cache_t::iterator> itp(create->cache.equal_range(m_hash));
99 for(; itp.first!=itp.second; ++itp.first) {
100 Field* cent(itp.first->second);
102 create->cache.erase(itp.first);
123 THROW_EXCEPTION2(std::invalid_argument,
"Can't construct Scalar from invalid ScalarType");
138 static const string idScalarLUT[] = {
152 return idScalarLUT[scalarType];
157 static const int8 typeCodeLUT[] = {
171 return typeCodeLUT[scalarType];
177 buffer->
putByte(getTypeCodeLUT(scalarType));
182 throw std::runtime_error(
"not valid operation, use FieldCreate::deserialize instead");
188 return getPVDataCreate()->createPVScalar(std::tr1::static_pointer_cast<const Scalar>(shared_from_this()));
195 std::ostringstream id;
229 string id = structure->
getID();
237 std::size_t len = fields.size();
239 for (std::size_t
i = 0;
i < len;
i++)
252 for (std::size_t
i = 0;
i < size;
i++)
268 string id = punion->
getID();
276 std::size_t len = fields.size();
278 for (std::size_t
i = 0;
i < len;
i++)
291 for (std::size_t
i = 0;
i < size;
i++)
298 return fieldCreate->
createUnion(fieldNames, fields);
300 return fieldCreate->
createUnion(
id, fieldNames, fields);
312 elementType(elementType)
315 throw std::invalid_argument(
"Can't construct ScalarArray from invalid ScalarType");
323 const string ScalarArray::getIDScalarArrayLUT()
const 325 static const string idScalarArrayLUT[] = {
339 return idScalarArrayLUT[elementType];
344 return getIDScalarArrayLUT();
354 buffer->
putByte((
int8)0x08 | Scalar::getTypeCodeLUT(elementType));
358 throw std::runtime_error(
"not valid operation, use FieldCreate::deserialize instead");
363 return getPVDataCreate()->createPVScalarArray(std::tr1::static_pointer_cast<const ScalarArray>(shared_from_this()));
382 return string(buffer);
407 return string(buffer);
430 return pstructure->getID() +
"[]";
450 throw std::runtime_error(
"not valid operation, use FieldCreate::deserialize instead");
455 return getPVDataCreate()->createPVStructureArray(std::tr1::static_pointer_cast<const StructureArray>(shared_from_this()));
470 return punion->
getID() +
"[]";
498 throw std::runtime_error(
"not valid operation, use FieldCreate::deserialize instead");
503 return getPVDataCreate()->createPVUnionArray(std::tr1::static_pointer_cast<const UnionArray>(shared_from_this()));
510 static const string id =
"structure";
519 fieldNames(fieldNames),
524 THROW_EXCEPTION2(std::invalid_argument,
"Can't construct Structure, id is empty string");
526 if(fieldNames.size()!=fields.size()) {
527 THROW_EXCEPTION2(std::invalid_argument,
"Can't construct Structure, fieldNames.size()!=fields.size()");
529 size_t number = fields.size();
530 for(
size_t i=0;
i<number;
i++) {
531 const string& name = fieldNames[
i];
533 THROW_EXCEPTION2(std::invalid_argument,
"Can't construct Structure, empty string in fieldNames");
535 if(fields[
i].
get()==
NULL)
536 THROW_EXCEPTION2(std::invalid_argument,
"Can't construct Structure, NULL in fields");
538 for(
size_t j=
i+1; j<number; j++) {
539 string otherName = fieldNames[j];
540 int result = name.compare(otherName);
542 string message(
"Can't construct Structure, duplicate fieldName ");
562 for(
size_t i=0, N=fields.size();
i<N;
i++) {
563 if(fieldName==fieldNames[
i]) {
571 size_t numberFields = fields.size();
572 for(
size_t i=0;
i<numberFields;
i++) {
574 int result = fieldName.compare(fieldNames[
i]);
575 if(result==0)
return i;
580 FieldConstPtr Structure::getFieldImpl(
string const & fieldName,
bool throws)
const {
581 for(
size_t i=0, N=fields.size();
i<N;
i++)
582 if(fieldName==fieldNames[
i])
586 std::stringstream ss;
587 ss <<
"Failed to get field: " 588 << fieldName <<
" (not found)";
589 throw std::runtime_error(ss.str());
605 void Structure::dumpFields(std::ostream& o)
const 607 size_t numberFields = fields.size();
608 for(
size_t i=0;
i<numberFields;
i++) {
610 o <<
format::indent() << pfield->getID() <<
' ' << fieldNames[
i] << std::endl;
611 switch(pfield->getType()) {
617 Field const *xxx = pfield.get();
620 pstruct->dumpFields(o);
626 Field const *xxx = pfield.get();
633 Field const *xxx = pfield.get();
634 Union const *punion =
static_cast<Union const*
>(xxx);
636 punion->dumpFields(o);
642 Field const *xxx = pfield.get();
654 serializeStructureField(
this, buffer, control);
658 throw std::runtime_error(
"not valid operation, use FieldCreate::deserialize instead");
663 return getPVDataCreate()->createPVStructure(std::tr1::static_pointer_cast<const Structure>(shared_from_this()));
670 static const string id =
"union";
678 static const string id =
"any";
696 fieldNames(fieldNames),
701 THROW_EXCEPTION2(std::invalid_argument,
"Can't construct Union, id is empty string");
703 if(fieldNames.size()!=fields.size()) {
704 THROW_EXCEPTION2(std::invalid_argument,
"Can't construct Union, fieldNames.size()!=fields.size()");
706 if(fields.size()==0 && inid!=
ANY_ID) {
707 THROW_EXCEPTION2(std::invalid_argument,
"Can't construct Union, no fields only allowed when id = " +
ANY_ID);
710 size_t number = fields.size();
711 for(
size_t i=0;
i<number;
i++) {
712 const string& name = fieldNames[
i];
714 THROW_EXCEPTION2(std::invalid_argument,
"Can't construct Union, empty string in fieldNames");
716 if(fields[
i].
get()==
NULL)
717 THROW_EXCEPTION2(std::invalid_argument,
"Can't construct Union, NULL in fields");
719 for(
size_t j=
i+1; j<number; j++) {
720 string otherName = fieldNames[j];
721 int result = name.compare(otherName);
723 string message(
"Can't construct Union, duplicate fieldName ");
739 THROW_EXCEPTION2(std::logic_error,
"PVUnion::guess() only support scalar and scalarArray");
742 for(
size_t i=0, N=fields.size();
i<N;
i++)
753 type =
static_cast<const ScalarArray*
>(fields[
i].get())->getElementType();
778 size_t numberFields = fields.size();
779 for(
size_t i=0;
i<numberFields;
i++) {
781 int result = fieldName.compare(fieldNames[
i]);
782 if(result==0)
return pfield;
788 size_t numberFields = fields.size();
789 for(
size_t i=0;
i<numberFields;
i++) {
791 int result = fieldName.compare(fieldNames[
i]);
792 if(result==0)
return i;
797 FieldConstPtr Union::getFieldImpl(
string const & fieldName,
bool throws)
const {
798 for(
size_t i=0, N=fields.size();
i<N;
i++)
799 if(fieldName==fieldNames[
i])
803 std::stringstream ss;
804 ss <<
"Failed to get field: " 805 << fieldName <<
" (not found)";
806 throw std::runtime_error(ss.str());
822 void Union::dumpFields(std::ostream& o)
const 824 size_t numberFields = fields.size();
825 for(
size_t i=0;
i<numberFields;
i++) {
827 o <<
format::indent() << pfield->getID() <<
' ' << fieldNames[
i] << std::endl;
828 switch(pfield->getType()) {
834 Field const *xxx = pfield.get();
837 pstruct->dumpFields(o);
848 Field const *xxx = pfield.get();
849 Union const *punion =
static_cast<Union const*
>(xxx);
851 punion->dumpFields(o);
866 if (fields.size() == 0)
874 serializeUnionField(
this, buffer, control);
879 throw std::runtime_error(
"not valid operation, use FieldCreate::deserialize instead");
884 return getPVDataCreate()->createPVUnion(std::tr1::static_pointer_cast<const Union>(shared_from_this()));
887 FieldBuilder::FieldBuilder()
890 ,nestedClassToBuild(structure)
895 FieldBuilder::FieldBuilder(
const Structure* S)
902 ,nestedClassToBuild(structure)
909 const std::string& name,
911 :fieldCreate(_parentBuilder->fieldCreate)
916 ,parentBuilder(_parentBuilder)
917 ,nestedClassToBuild(structure)
924 const std::string& name,
931 ,parentBuilder(_parentBuilder)
932 ,nestedClassToBuild(structure)
939 const std::string& name,
946 ,parentBuilder(_parentBuilder)
947 ,nestedClassToBuild(
union_)
954 const std::string& name,
959 ,fieldNames(S->
getUnion()->getFieldNames())
961 ,parentBuilder(_parentBuilder)
962 ,nestedClassToBuild(
union_)
969 string const & _nestedName,
970 Type _nestedClassToBuild,
bool _nestedArray)
971 :fieldCreate(_parentBuilder->fieldCreate)
973 ,parentBuilder(_parentBuilder)
974 ,nestedClassToBuild(_nestedClassToBuild)
975 ,nestedName(_nestedName)
976 ,nestedArray(_nestedArray)
980 void FieldBuilder::reset()
1005 return shared_from_this();
1010 return add(name, fieldCreate->
createScalar(scalarType));
1020 const Field* cur = findField(name, field->getType());
1022 fields.push_back(field); fieldNames.push_back(name);
1023 }
else if(*cur!=*field) {
1024 THROW_EXCEPTION2(std::runtime_error,
"duplicate field name w/ different type : "+name);
1026 return shared_from_this();
1047 switch (element->getType())
1053 fld = fieldCreate->
createUnionArray(static_pointer_cast<const Union>(element));
1057 if (std::tr1::dynamic_pointer_cast<const BoundedString>(element).
get())
1058 THROW_EXCEPTION2(std::invalid_argument,
"bounded string arrays are not supported");
1064 std::ostringstream msg(
"unsupported array element type: ");
1065 msg << element->getType();
1069 return add(name, fld);
1075 if (fieldNames.size() == 0 && type ==
union_)
1078 if (type == structure)
1087 fieldCreate->
createUnion(
id, fieldNames, fields) :
1092 std::ostringstream msg(
"unsupported type: ");
1101 if (parentBuilder.get())
1102 THROW_EXCEPTION2(std::runtime_error,
"createStructure() called in nested FieldBuilder");
1104 StructureConstPtr field(static_pointer_cast<const Structure>(createFieldInternal(structure)));
1111 if (parentBuilder.get())
1112 THROW_EXCEPTION2(std::runtime_error,
"createUnion() called in nested FieldBuilder");
1119 const Field* FieldBuilder::findField(
const std::string& name,
Type ftype)
1122 for(
size_t i=0;
i<fieldNames.size();
i++)
1124 if(name!=fieldNames[
i])
1127 if(fields[i]->
getType()!=ftype)
1128 THROW_EXCEPTION2(std::invalid_argument,
"nested field not required type: "+name);
1130 return fields[
i].get();
1137 const Field *cur = findField(name, structure);
1140 static_cast<const Structure*>(cur)));
1151 static_cast<const Union*>(cur)));
1162 static_cast<const StructureArray*>(cur)));
1172 static_cast<const UnionArray*>(cur)));
1180 THROW_EXCEPTION2(std::runtime_error,
"FieldBuilder::endNested() can only be called to create nested fields");
1182 FieldConstPtr nestedField = createFieldInternal(nestedClassToBuild);
1186 parentBuilder->addArray(nestedName, nestedField);
1188 parentBuilder->add(nestedName, nestedField);
1189 return parentBuilder;
1191 for(
size_t i=0, N = parentBuilder->fieldNames.size();
i<N;
i++)
1193 if(nestedName!=parentBuilder->fieldNames[
i])
1197 if(nestedClassToBuild==structure)
1198 parentBuilder->fields[
i] = fieldCreate->
createStructureArray(std::tr1::static_pointer_cast<const Structure>(nestedField));
1199 else if(nestedClassToBuild==
union_)
1200 parentBuilder->fields[
i] = fieldCreate->
createUnionArray(std::tr1::static_pointer_cast<const Union>(nestedField));
1202 throw std::logic_error(
"bad nested class");
1204 parentBuilder->fields[
i] = nestedField;
1206 return parentBuilder;
1227 std::ostringstream strm(
"Can't construct Scalar from invalid ScalarType ");
1232 return scalars[scalarType];
1237 std::tr1::shared_ptr<BoundedString> s(
new BoundedString(maxLength));
1245 std::ostringstream strm(
"Can't construct ScalarArray from invalid ScalarType ");
1246 strm << elementType;
1250 return scalarArrays[elementType];
1256 std::ostringstream strm(
"Can't construct fixed ScalarArray from invalid ScalarType ");
1257 strm << elementType;
1261 std::tr1::shared_ptr<ScalarArray> s(
new FixedScalarArray(elementType, size));
1269 std::ostringstream strm(
"Can't construct bounded ScalarArray from invalid ScalarType ");
1270 strm << elementType;
1283 return createStructure(fieldNames,fields);
1287 bool xisalnum(
char c)
1289 return (c>=
'a' && c<=
'z') || (c>=
'A' && c<='Z') || (c>=
'0' && c<=
'9');
1292 void validateFieldName(
const std::string& n)
1296 throw std::invalid_argument(
"zero length field names not allowed");
1297 if(n[0]>=
'0' && n[0]<=
'9') {
1298 std::ostringstream msg;
1299 msg<<
"Field name \""<<n<<
"\" must begin with A-Z, a-z, or '_'";
1300 throw std::invalid_argument(msg.str());
1302 for(
size_t i=0, N=n.size();
i<N;
i++)
1312 std::ostringstream msg;
1313 msg<<
"Invalid charactor '"<<c<<
"' ("<<(int)c<<
") in field name \""<<n<<
"\" " 1314 "must be A-Z, a-z, 0-9, or '_'";
1315 throw std::invalid_argument(msg.str());
1324 for(StringArray::const_iterator it=l.begin(), end=l.end(); it!=end; ++it)
1325 validateFieldName(*it);
1332 validateFieldNames(fieldNames);
1333 std::tr1::shared_ptr<Structure> sp(
new Structure(fieldNames,fields));
1343 validateFieldNames(fieldNames);
1344 std::tr1::shared_ptr<Structure> sp(
new Structure(fieldNames,fields,
id));
1352 std::tr1::shared_ptr<StructureArray> sp(
new StructureArray(structure));
1360 validateFieldNames(fieldNames);
1361 std::tr1::shared_ptr<Union> sp(
new Union(fieldNames,fields));
1371 validateFieldNames(fieldNames);
1372 std::tr1::shared_ptr<Union> sp(
new Union(fieldNames,fields,
id));
1379 return variantUnion;
1385 std::tr1::shared_ptr<UnionArray> sp(
new UnionArray(punion));
1392 return variantUnionArray;
1397 string const & fieldName,
1400 StringArray const & oldNames = structure->getFieldNames();
1402 size_t oldLen = oldNames.size();
1405 for(
size_t i = 0;
i<oldLen;
i++) {
1406 newNames[
i] = oldNames[
i];
1407 newFields[
i] = oldFields[
i];
1409 newNames[oldLen] = fieldName;
1410 newFields[oldLen] = field;
1411 return createStructure(structure->getID(),newNames,newFields);
1419 validateFieldNames(fieldNames);
1420 StringArray const & oldNames = structure->getFieldNames();
1422 size_t oldLen = oldNames.size();
1423 size_t extra = fieldNames.size();
1426 for(
size_t i = 0;
i<oldLen;
i++) {
1427 newNames[
i] = oldNames[
i];
1428 newFields[
i] = oldFields[
i];
1430 for(
size_t i = 0;
i<extra;
i++) {
1431 newNames[oldLen +
i] = fieldNames[
i];
1432 newFields[oldLen +
i] = fields[
i];
1434 return createStructure(structure->getID(),newNames,newFields);
1438 static int decodeScalar(
int8 code)
1440 static const int integerLUT[] =
1452 static const int floatLUT[] =
1467 case 1:
return integerLUT[code & 0x07];
1468 case 2:
return floatLUT[code & 0x07];
1481 int typeCode = code & 0xE7;
1482 int scalarOrArray = code & 0x18;
1483 bool notArray = (scalarOrArray == 0);
1486 if (typeCode < 0x80)
1489 int scalarType = decodeScalar(code);
1490 if (scalarType == -1)
1491 throw std::invalid_argument(
"invalid scalar type encoding");
1492 return scalars[scalarType];
1494 else if (typeCode == 0x80)
1497 return deserializeStructureField(
this, buffer, control);
1499 else if (typeCode == 0x81)
1502 return deserializeUnionField(
this, buffer, control);
1504 else if (typeCode == 0x82)
1507 return variantUnion;
1509 else if (typeCode == 0x83)
1516 std::tr1::shared_ptr<Field> sp(
1522 throw std::invalid_argument(
"invalid type encoding");
1526 bool isVariable = (scalarOrArray == 0x08);
1528 bool isFixed = (scalarOrArray == 0x18);
1532 if (typeCode < 0x80)
1535 int scalarType = decodeScalar(code);
1536 if (scalarType == -1)
1537 throw std::invalid_argument(
"invalid scalarArray type encoding");
1539 return scalarArrays[scalarType];
1543 std::tr1::shared_ptr<Field> sp(
1544 new FixedScalarArray(static_cast<epics::pvData::ScalarType>(scalarType), size));
1551 std::tr1::shared_ptr<Field> sp(
1557 else if (typeCode == 0x80)
1561 throw std::invalid_argument(
"fixed and bounded structure array not supported");
1566 std::tr1::shared_ptr<Field> sp(
new StructureArray(elementStructure));
1570 else if (typeCode == 0x81)
1574 throw std::invalid_argument(
"fixed and bounded structure array not supported");
1579 std::tr1::shared_ptr<Field> sp(
new UnionArray(elementUnion));
1583 else if (typeCode == 0x82)
1587 throw std::invalid_argument(
"fixed and bounded structure array not supported");
1590 return variantUnionArray;
1593 throw std::invalid_argument(
"invalid type encoding");
1610 static void field_factory_init(
void*)
1614 }
catch(std::exception& e){
1615 std::cerr<<
"Error initializing getFieldCreate() : "<<e.what()<<
"\n";
1623 throw std::logic_error(
"getFieldCreate() not initialized");
1627 FieldCreate::FieldCreate()
1631 std::tr1::shared_ptr<Scalar> sp(
new Scalar(static_cast<ScalarType>(
i)));
1633 scalars.push_back(sp);
1635 std::tr1::shared_ptr<ScalarArray> spa(
new ScalarArray(static_cast<ScalarType>(
i)));
1637 scalarArrays.push_back(spa);
1640 std::tr1::shared_ptr<Union> su(
new Union());
1644 std::tr1::shared_ptr<UnionArray> sua(
new UnionArray(variantUnion));
1646 variantUnionArray = sua;
1654 if(ptr)
return o << *ptr;
1655 return o <<
"nullptr";
virtual void deserialize(ByteBuffer *buffer, DeserializableControl *control) OVERRIDE FINAL
StructureConstPtr createStructure() const
unsigned int epicsStrHash(const char *str, unsigned int seed)
virtual ~StructureArray()
FieldBuilderPtr addArray(std::string const &name, ScalarType scalarType)
std::tr1::shared_ptr< PVUnion > build() const
epics::pvData::BitSetPtr empty
This class implements introspection object for Scalar.
This class implements introspection object for a union.
const char * name(ScalarType t)
EPICS_ALWAYS_INLINE int8 getByte()
FixedScalarArray(ScalarType scalarType, std::size_t size)
#define THROW_EXCEPTION2(TYPE, MSG)
static std::string deserializeString(ByteBuffer *buffer, DeserializableControl *control)
virtual void deserialize(ByteBuffer *buffer, DeserializableControl *control) OVERRIDE FINAL
virtual std::ostream & dump(std::ostream &o) const OVERRIDE FINAL
virtual void deserialize(ByteBuffer *buffer, DeserializableControl *control) OVERRIDE FINAL
ScalarType getScalarType(const string &pvalue)
virtual void serialize(ByteBuffer *buffer, SerializableControl *control) const OVERRIDE FINAL
std::size_t getFieldIndex(std::string const &fieldName) const
ScalarArray(ScalarType scalarType)
UnionConstPtr createUnion()
static size_t num_instances
shared_ptr< T > static_pointer_cast(shared_ptr< U > const &r) BOOST_NOEXCEPT
virtual std::string getID() const OVERRIDE FINAL
virtual void serialize(ByteBuffer *buffer, SerializableControl *control) const OVERRIDE FINAL
static const std::string & anyId()
StructureArrayConstPtr createStructureArray(StructureConstPtr const &structure) const
virtual void deserialize(ByteBuffer *buffer, DeserializableControl *control) OVERRIDE FINAL
pvd::StructureConstPtr type
const StructureConstPtr & getStructure() const
TODO only here because of the Lockable.
virtual std::string getID() const OVERRIDE FINAL
FieldBuilderPtr addBoundedArray(std::string const &name, ScalarType scalarType, std::size_t bound) PVD_DEPRECATED_52
std::tr1::shared_ptr< const Structure > StructureConstPtr
A lock for multithreading.
std::tr1::shared_ptr< const StructureArray > StructureArrayConstPtr
StructureArray(StructureConstPtr const &structure)
FieldConstPtrArray const & getFields() const
static void writeSize(std::size_t s, ByteBuffer *buffer, SerializableControl *flusher)
ScalarType getElementType() const
static std::size_t readSize(ByteBuffer *buffer, DeserializableControl *control)
FieldBuilderPtr endNested()
Callback class for deserialization.
static const std::string DEFAULT_ID
virtual std::string getID() const OVERRIDE FINAL
Structure(StringArray const &fieldNames, FieldConstPtrArray const &fields, std::string const &id=defaultId())
std::ostream & operator<<(std::ostream &o, const Field &f)
Interface for in-line creating of introspection interfaces.
std::tr1::shared_ptr< FieldBuilder > FieldBuilderPtr
FieldCreatePtr fieldCreate
This class implements introspection object for bounded scalar array.
virtual void serialize(ByteBuffer *buffer, SerializableControl *control) const OVERRIDE
std::tr1::shared_ptr< const Scalar > ScalarConstPtr
BoundedScalarArray(ScalarType scalarType, std::size_t size)
Scalar(ScalarType scalarType)
UnionConstPtr createUnion(StringArray const &fieldNames, FieldConstPtrArray const &fields) const
virtual void serialize(ByteBuffer *buffer, SerializableControl *control) const OVERRIDE FINAL
This class implements introspection object for field.
virtual std::ostream & dump(std::ostream &o) const OVERRIDE FINAL
FieldConstPtr getField(std::string const &fieldName) const
virtual std::tr1::shared_ptr< const Field > cachedDeserialize(ByteBuffer *buffer)=0
StructureConstPtr createStructure()
virtual ~FixedScalarArray()
#define EPICS_THREAD_ONCE_INIT
virtual void deserialize(ByteBuffer *buffer, DeserializableControl *control) OVERRIDE FINAL
virtual std::string getID() const OVERRIDE FINAL
UnionArray(UnionConstPtr const &_punion)
virtual void serialize(ByteBuffer *buffer, SerializableControl *control) const OVERRIDE
std::tr1::shared_ptr< const Union > UnionConstPtr
FieldBuilderPtr addNestedUnionArray(std::string const &name)
std::tr1::shared_ptr< PVScalarArray > build() const
This class implements introspection object for a structure.
static unsigned hash(Field *fld)
FieldBuilderPtr addNestedStructure(std::string const &name)
StructureConstPtr appendFields(StructureConstPtr const &structure, StringArray const &fieldNames, FieldConstPtrArray const &fields) const
UnionArrayConstPtr createVariantUnionArray() const
APIs for the epicsMutex mutual exclusion semaphore.
virtual ~BoundedScalarArray()
LIBCOM_API void epicsStdCall epicsThreadOnce(epicsThreadOnceId *id, EPICSTHREADFUNC, void *arg)
std::size_t getFieldIndex(std::string const &fieldName) const
UnionConstPtr createVariantUnion() const
FieldBuilderPtr addFixedArray(std::string const &name, ScalarType scalarType, std::size_t size) PVD_DEPRECATED_52
bool compare(const Field &a, const Field &b)
ScalarConstPtr createScalar(ScalarType scalarType) const
std::tr1::shared_ptr< PVValueArray< std::tr1::shared_ptr< PVStructure > > > build() const
std::tr1::shared_ptr< const BoundedString > BoundedStringConstPtr
This class implements introspection object for Array.
FieldBuilderPtr addNestedUnion(std::string const &name)
virtual void serialize(ByteBuffer *buffer, SerializableControl *control) const OVERRIDE FINAL
EPICS_ALWAYS_INLINE void putByte(int8 value)
This class implements a Bytebuffer that is like the java.nio.ByteBuffer.
static void cache(const FieldCreate *create, std::tr1::shared_ptr< FLD > &ent)
StringArray const & getFieldNames() const
static const std::string & defaultId()
std::vector< FieldConstPtr > FieldConstPtrArray
UnionArrayConstPtr createUnionArray(UnionConstPtr const &punion) const
This class implements introspection object for BoundedString.
static void serializeString(const std::string &value, ByteBuffer *buffer, SerializableControl *flusher)
std::tr1::shared_ptr< PVField > build() const
This class implements introspection object for a unionArray.
virtual std::string getID() const OVERRIDE
virtual void serialize(ByteBuffer *buffer, SerializableControl *control) const OVERRIDE FINAL
std::tr1::shared_ptr< const Field > FieldConstPtr
BoundedStringConstPtr createBoundedString(std::size_t maxLength) const PVD_DEPRECATED_52
virtual std::string getID() const OVERRIDE FINAL
virtual void cachedSerialize(std::tr1::shared_ptr< const Field > const &field, ByteBuffer *buffer)=0
This is a singleton class for creating introspection interfaces.
FORCE_INLINE const FieldCreatePtr & getFieldCreate()
virtual void serialize(ByteBuffer *buffer, SerializableControl *control) const OVERRIDE FINAL
static size_t num_instances
void registerRefCounter(const char *name, const size_t *counter)
std::tr1::shared_ptr< PVStructure > build() const
std::tr1::shared_ptr< const ScalarArray > ScalarArrayConstPtr
This class implements introspection object for scalar array.
virtual std::string getID() const OVERRIDE FINAL
This class implements introspection object for a structureArray.
ScalarArrayConstPtr createScalarArray(ScalarType elementType) const
FieldConstPtr getField(std::string const &fieldName) const
UnionConstPtr getUnion() const
BoundedString(std::size_t maxStringLength)
std::vector< std::string > StringArray
FieldBuilderPtr setId(std::string const &id)
virtual void deserialize(ByteBuffer *buffer, DeserializableControl *control) OVERRIDE FINAL
static const std::string ANY_ID
std::tr1::shared_ptr< FieldCreate > FieldCreatePtr
virtual void serialize(ByteBuffer *buffer, SerializableControl *control) const OVERRIDE FINAL
std::tr1::shared_ptr< PVScalar > build() const
virtual std::string getID() const OVERRIDE FINAL
This class implements introspection object for bounded scalar array.
std::size_t getMaximumLength() const
virtual void ensureBuffer(std::size_t size)=0
virtual std::ostream & dump(std::ostream &o) const OVERRIDE FINAL
friend class StructureArray
Callback class for serialization.
std::tr1::shared_ptr< PVValueArray< std::tr1::shared_ptr< PVUnion > > > build() const
FieldConstPtrArray const & getFields() const
StructureConstPtr appendField(StructureConstPtr const &structure, std::string const &fieldName, FieldConstPtr const &field) const
virtual std::ostream & dump(std::ostream &o) const =0
virtual std::ostream & dump(std::ostream &o) const OVERRIDE FINAL
FieldBuilderPtr addNestedStructureArray(std::string const &name)
virtual void ensureData(std::size_t size)=0
ScalarArrayConstPtr createBoundedScalarArray(ScalarType elementType, std::size_t bound) const PVD_DEPRECATED_52
C++ and C descriptions for a thread.
ScalarArrayConstPtr createFixedScalarArray(ScalarType elementType, std::size_t size) const PVD_DEPRECATED_52
virtual std::string getID() const OVERRIDE
FieldBuilderPtr add(std::string const &name, ScalarType scalarType)
virtual std::ostream & dump(std::ostream &o) const OVERRIDE FINAL
int32 guess(Type t, ScalarType s) const
FieldBuilderPtr createFieldBuilder() const
FieldBuilderPtr addBoundedString(std::string const &name, std::size_t maxLength) PVD_DEPRECATED_52
static const FieldCreatePtr & getFieldCreate()
static FieldBuilderPtr begin()
FORCE_INLINE const PVDataCreatePtr & getPVDataCreate()
static const std::string DEFAULT_ID
static const std::string & defaultId()
virtual std::ostream & dump(std::ostream &o) const OVERRIDE FINAL
FieldConstPtr deserialize(ByteBuffer *buffer, DeserializableControl *control) const
StringArray const & getFieldNames() const
std::tr1::shared_ptr< const UnionArray > UnionArrayConstPtr