OpenDDS  Snapshot(2023/04/28-20:55)
UpdateManager.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef UPDATE_MANAGER_H
9 #define UPDATE_MANAGER_H
10 
11 #include "inforepo_export.h"
12 #include "UpdateDataTypes.h"
13 #include "Updater.h"
14 
15 #include "dds/DdsDcpsInfrastructureC.h"
16 #include "dds/DdsDcpsInfoUtilsC.h"
17 
18 #include "tao/CDR.h"
19 
20 #include "ace/Service_Object.h"
21 #include "ace/Service_Config.h"
22 
23 #include <set>
24 
26 
27 // forward declarations
28 class TAO_DDS_DCPSInfo_i;
29 
30 namespace Update {
31 
33 public:
34  Manager();
35 
36  virtual ~Manager();
37 
38  /// Shared object initializer
39  virtual int init(int argc, ACE_TCHAR *argv[]);
40 
41  /// Shared object finalizer
42  virtual int fini();
43 
44  // mechanism for InfoRepo object to be registered.
45  void add(TAO_DDS_DCPSInfo_i* info);
46  void add(Updater* updater);
47 
48  // Mechanism to unregister Updaters/InfoRepo
49  void remove();
50  void remove(const Updater* updater);
51 
52  /// Force a clean shutdown.
53  // void shutdown (void);
54 
55  /// Upstream request for a fresh image
56  /// Currently handled synchronously via 'pushImage'
57  /// TBD: Replace with an asynchronous model.
58  void requestImage();
59 
60  /// Downstream request to push image
61  void pushImage(const DImage& image);
62 
63  // Propagate creation of entities.
64  template<class UType>
65  void create(const UType& info);
66 
67  // Propagate QoS updates.
68  template<class QosType>
69  void update(const IdPath& id, const QosType& qos);
70 
71  // Propagate destruction of entities.
72  void destroy(const IdPath& id, ItemType type, ActorType actor = DataWriter);
73 
74  // Downstream request to push persisted data
75  void add(const DTopic& topic);
76  void add(const DParticipant& participant);
77  void add(const DActor& actor);
78 
79  /// Update Last Participant Id for the repo
80  virtual void updateLastPartId(PartIdType partId);
81 
82 private:
83  typedef std::set <Updater*> Updaters;
84 
85  // required to break an include dependency loop
86  //void add (Updater* updater, const DActor& actor);
87 
89  Updaters updaters_;
90 };
91 
92 } // End of namespace Update
93 
95 
96 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
97 #include "UpdateManager_T.cpp"
98 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
99 
100 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
101 #pragma message ("UpdateManager_T.cpp template inst")
102 #pragma implementation ("UpdateManager_T.cpp")
103 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
104 
106 
108 
110 
111 ACE_FACTORY_DECLARE(ACE_Local_Service, UpdateManagerSvc)
112 
114 public:
115  static int init();
116 };
117 
118 #if defined(ACE_HAS_BROKEN_STATIC_CONSTRUCTORS)
119 
120 typedef int (*UpdateManagerSvc_Loader)();
121 
124 
125 #else
126 
127 static int ldr =
129 
130 #endif /* ACE_HAS_BROKEN_STATIC_CONSTRUCTORS */
131 
133 
134 #endif /* UPDATE_MANAGER_H */
std::set< Updater * > Updaters
Definition: UpdateManager.h:83
long PartIdType
#define ACE_STATIC_SVC_DECLARE(SERVICE_CLASS)
#define OpenDDS_InfoRepoLib_Export
OPENDDS_END_VERSIONED_NAMESPACE_DECL OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL typedef Update::Manager UpdateManagerSvc
static int ldr
char ACE_TCHAR
int init(void)
Implementation of the DCPSInfo.
Definition: DCPSInfo_i.h:53
Updaters updaters_
Definition: UpdateManager.h:89
#define ACE_FACTORY_DECLARE(CLS, SERVICE_CLASS)
int fini(void)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
TAO_DDS_DCPSInfo_i * info_
Definition: UpdateManager.h:88