pvAccessCPP  7.1.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
introspectionRegistry.h
1 
7 #ifndef INTROSPECTIONREGISTRY_H
8 #define INTROSPECTIONREGISTRY_H
9 
10 #include <map>
11 #include <iostream>
12 
13 #ifdef epicsExportSharedSymbols
14 # define introspectionRegistryEpicsExportSharedSymbols
15 # undef epicsExportSharedSymbols
16 #endif
17 
18 #include <pv/lock.h>
19 #include <pv/pvIntrospect.h>
20 #include <pv/pvData.h>
21 #include <pv/byteBuffer.h>
22 #include <pv/serialize.h>
23 #include <pv/serializeHelper.h>
24 #include <pv/status.h>
25 #include <pv/standardField.h>
26 
27 #ifdef introspectionRegistryEpicsExportSharedSymbols
28 # define epicsExportSharedSymbols
29 # undef introspectionRegistryEpicsExportSharedSymbols
30 #endif
31 
32 // TODO check for memory leaks
33 
34 namespace epics {
35 namespace pvAccess {
36 
38 
39 
46  EPICS_NOT_COPYABLE(IntrospectionRegistry)
47 public:
49  virtual ~IntrospectionRegistry();
50 
54  void reset();
55 
56 private:
67  epics::pvData::int16 registerIntrospectionInterface(epics::pvData::FieldConstPtr const & field, bool& existing);
68 public:
76  void serialize(epics::pvData::FieldConstPtr const & field, epics::pvData::ByteBuffer* buffer, epics::pvData::SerializableControl* control);
77 
88  epics::pvData::FieldConstPtr deserialize(epics::pvData::ByteBuffer* buffer, epics::pvData::DeserializableControl* control);
89 
93  const static epics::pvData::int8 NULL_TYPE_CODE;
94 
98  const static epics::pvData::int8 ONLY_ID_TYPE_CODE;
99 
103  const static epics::pvData::int8 FULL_WITH_ID_TYPE_CODE;
104 
105 private:
106  registryMap_t _registry;
107  epics::pvData::int16 _pointer;
108 
112  static epics::pvData::FieldCreatePtr _fieldCreate;
113 
114  bool registryContainsValue(epics::pvData::FieldConstPtr const & field, epics::pvData::int16& key);
115 };
116 
117 }
118 }
119 
120 #endif /* INTROSPECTIONREGISTRY_H */
epics::pvData::FieldConstPtr deserialize(epics::pvData::ByteBuffer *buffer, epics::pvData::DeserializableControl *control)
Deserializes introspection interface.
void serialize(epics::pvData::FieldConstPtr const &field, epics::pvData::ByteBuffer *buffer, epics::pvData::SerializableControl *control)
Serializes introspection interface.
static const epics::pvData::int8 FULL_WITH_ID_TYPE_CODE
Serialization contains an ID (that can be used later, if cached) and full interface description...
void reset()
Resets registry, i.e.
static const epics::pvData::int8 NULL_TYPE_CODE
Null type.
static const epics::pvData::int8 ONLY_ID_TYPE_CODE
Serialization contains only an ID (that was assigned by one of the previous FULL_WITH_ID descriptions...