00001
00002
00003
00004
00005
00006
00007
00008 #ifndef UPDATE_DATA_TYPES
00009 #define UPDATE_DATA_TYPES
00010
00011 #include "dds/DdsDcpsInfoUtilsC.h"
00012 #include "dds/DdsDcpsInfrastructureC.h"
00013
00014 #include <vector>
00015 #include <string>
00016 #include <map>
00017
00018 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00019
00020 namespace Update {
00021
00022 enum ItemType { Topic, Participant, Actor };
00023 enum ActorType { DataReader, DataWriter };
00024 enum SpecificQos {
00025 NoQos,
00026 ParticipantQos,
00027 TopicQos,
00028 DataWriterQos,
00029 PublisherQos,
00030 DataReaderQos,
00031 SubscriberQos
00032 };
00033
00034 typedef DDS::DomainId_t DomainIdType;
00035 typedef OpenDDS::DCPS::RepoId IdType;
00036 typedef std::pair <size_t, char*> BinSeq;
00037 typedef std::pair <SpecificQos, BinSeq> QosSeq;
00038 typedef long PartIdType;
00039
00040 struct IdPath {
00041 DomainIdType domain;
00042 IdType participant;
00043 IdType id;
00044
00045 IdPath(DomainIdType d, IdType p, IdType i)
00046 : domain(d),
00047 participant(p),
00048 id(i) { }
00049 };
00050
00051 struct OwnershipData {
00052 DomainIdType domain;
00053 IdType participant;
00054 long owner;
00055
00056 OwnershipData(DomainIdType d, IdType p, long o)
00057 : domain(d),
00058 participant(p),
00059 owner(o) { }
00060 };
00061
00062 template <typename Q, typename S>
00063 struct TopicStrt {
00064 DomainIdType domainId;
00065 IdType topicId;
00066 IdType participantId;
00067 S name;
00068 S dataType;
00069 Q topicQos;
00070
00071 TopicStrt(
00072 DomainIdType dom,
00073 IdType to,
00074 IdType pa,
00075 const char* na,
00076 const char* da,
00077 Q tQos) :
00078 domainId(dom),
00079 topicId(to),
00080 participantId(pa),
00081 name(na),
00082 dataType(da),
00083 topicQos(tQos) { };
00084 };
00085 typedef struct TopicStrt<DDS::TopicQos&, std::string> UTopic;
00086 typedef struct TopicStrt<QosSeq, std::string> DTopic;
00087
00088 template <typename Q>
00089 struct ParticipantStrt {
00090 DomainIdType domainId;
00091 long owner;
00092 IdType participantId;
00093 Q participantQos;
00094
00095 ParticipantStrt(
00096 DomainIdType dom,
00097 long own,
00098 IdType part,
00099 Q pQos):
00100 domainId(dom),
00101 owner(own),
00102 participantId(part),
00103 participantQos(pQos) { };
00104 };
00105 typedef struct ParticipantStrt<DDS::DomainParticipantQos&> UParticipant;
00106 typedef struct ParticipantStrt<QosSeq> DParticipant;
00107
00108 struct ContentSubscriptionInfo {
00109 CORBA::String_var filterClassName;
00110 CORBA::String_var filterExpr;
00111 DDS::StringSeq exprParams;
00112
00113 ContentSubscriptionInfo() {}
00114 ContentSubscriptionInfo(const char* fcn, const char* fx, const DDS::StringSeq& ep)
00115 : filterClassName(fcn), filterExpr(fx), exprParams(ep) {}
00116 };
00117
00118
00119
00120
00121 struct ContentSubscriptionBin {
00122 ACE_CString filterClassName;
00123 ACE_CString filterExpr;
00124 BinSeq exprParams;
00125 };
00126
00127 template <typename PSQ, typename RWQ, typename C, typename T, typename CSP>
00128 struct ActorStrt {
00129 DomainIdType domainId;
00130 IdType actorId;
00131 IdType topicId;
00132 IdType participantId;
00133 ActorType type;
00134 C callback;
00135 PSQ pubsubQos;
00136 RWQ drdwQos;
00137 T transportInterfaceInfo;
00138 CSP contentSubscriptionProfile;
00139
00140 ActorStrt(
00141 DomainIdType dom,
00142 IdType act,
00143 IdType top,
00144 IdType part,
00145 ActorType typ,
00146 const char* call,
00147 PSQ pub,
00148 RWQ drdw,
00149 T trans,
00150 CSP csProf)
00151 : domainId(dom),
00152 actorId(act),
00153 topicId(top),
00154 participantId(part),
00155 type(typ),
00156 callback(call),
00157 pubsubQos(pub),
00158 drdwQos(drdw),
00159 transportInterfaceInfo(trans),
00160 contentSubscriptionProfile(csProf)
00161 { };
00162 };
00163 typedef struct ActorStrt<
00164 DDS::SubscriberQos&,
00165 DDS::DataReaderQos&,
00166 std::string,
00167 OpenDDS::DCPS::TransportLocatorSeq&,
00168 ContentSubscriptionInfo&> URActor;
00169 typedef struct ActorStrt<
00170 DDS::PublisherQos&,
00171 DDS::DataWriterQos&,
00172 std::string,
00173 OpenDDS::DCPS::TransportLocatorSeq&,
00174 ContentSubscriptionInfo&> UWActor;
00175 typedef struct ActorStrt<QosSeq, QosSeq, std::string,
00176 BinSeq, ContentSubscriptionBin> DActor;
00177
00178 template <typename T, typename P, typename A, typename W>
00179 struct ImageData {
00180 typedef std::vector<T> TopicSeq;
00181 typedef std::vector<P> ParticipantSeq;
00182 typedef std::vector<A> ReaderSeq;
00183 typedef std::vector<W> WriterSeq;
00184
00185 unsigned long sequenceNumber;
00186 TopicSeq topics;
00187 ParticipantSeq participants;
00188 ReaderSeq actors;
00189 WriterSeq wActors;
00190
00191
00192 PartIdType lastPartId;
00193 };
00194 typedef struct ImageData<UTopic*, UParticipant*, URActor*, UWActor*> UImage;
00195 typedef struct ImageData<DTopic, DParticipant, DActor, DActor> DImage;
00196
00197 }
00198
00199 OPENDDS_END_VERSIONED_NAMESPACE_DECL
00200
00201 #endif