modelgbp Generated OpFlex Model  1.9.0
inv/Universe.hpp
1 
10 #pragma once
11 #ifndef GI_INV_UNIVERSE_HPP
12 #define GI_INV_UNIVERSE_HPP
13 
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
17 /*
18  * contains: item:mclass(inv/LocalEndpointInventory)
19  */
20 #include "modelgbp/inv/LocalEndpointInventory.hpp"
21 /*
22  * contains: item:mclass(inv/RemoteEndpointInventory)
23  */
24 #include "modelgbp/inv/RemoteEndpointInventory.hpp"
25 
26 namespace modelgbp {
27 namespace inv {
28 
29 class Universe
30  : public opflex::modb::mointernal::MO
31 {
32 public:
33 
37  static const opflex::modb::class_id_t CLASS_ID = 116;
38 
50  static boost::optional<OF_SHARED_PTR<modelgbp::inv::Universe> > resolve(
51  opflex::ofcore::OFFramework& framework,
52  const opflex::modb::URI& uri)
53  {
54  return opflex::modb::mointernal::MO::resolve<modelgbp::inv::Universe>(framework, CLASS_ID, uri);
55  }
56 
68  static boost::optional<OF_SHARED_PTR<modelgbp::inv::Universe> > resolve(
69  const opflex::modb::URI& uri)
70  {
71  return opflex::modb::mointernal::MO::resolve<modelgbp::inv::Universe>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
72  }
73 
88  static boost::optional<OF_SHARED_PTR<modelgbp::inv::Universe> > resolve(
89  opflex::ofcore::OFFramework& framework)
90  {
91  return resolve(framework,opflex::modb::URIBuilder().addElement("InvUniverse").build());
92  }
93 
107  static boost::optional<OF_SHARED_PTR<modelgbp::inv::Universe> > resolve(
108  )
109  {
110  return resolve(opflex::ofcore::OFFramework::defaultInstance());
111  }
112 
124  boost::optional<OF_SHARED_PTR<modelgbp::inv::LocalEndpointInventory> > resolveInvLocalEndpointInventory(
125  const std::string& invLocalEndpointInventoryName)
126  {
127  return modelgbp::inv::LocalEndpointInventory::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("InvLocalEndpointInventory").addElement(invLocalEndpointInventoryName).build());
128  }
129 
142  OF_SHARED_PTR<modelgbp::inv::LocalEndpointInventory> addInvLocalEndpointInventory(
143  const std::string& invLocalEndpointInventoryName)
144  {
145  OF_SHARED_PTR<modelgbp::inv::LocalEndpointInventory> result = addChild<modelgbp::inv::LocalEndpointInventory>(
146  CLASS_ID, getURI(), 2151284853ul, 117,
147  opflex::modb::URIBuilder(getURI()).addElement("InvLocalEndpointInventory").addElement(invLocalEndpointInventoryName).build()
148  );
149  result->setName(invLocalEndpointInventoryName);
150  return result;
151  }
152 
167  void resolveInvLocalEndpointInventory(/* out */ std::vector<OF_SHARED_PTR<modelgbp::inv::LocalEndpointInventory> >& out)
168  {
169  opflex::modb::mointernal::MO::resolveChildren<modelgbp::inv::LocalEndpointInventory>(
170  getFramework(), CLASS_ID, getURI(), 2151284853ul, 117, out);
171  }
172 
182  boost::optional<OF_SHARED_PTR<modelgbp::inv::RemoteEndpointInventory> > resolveInvRemoteEndpointInventory(
183  )
184  {
185  return modelgbp::inv::RemoteEndpointInventory::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("InvRemoteEndpointInventory").build());
186  }
187 
198  OF_SHARED_PTR<modelgbp::inv::RemoteEndpointInventory> addInvRemoteEndpointInventory(
199  )
200  {
201  OF_SHARED_PTR<modelgbp::inv::RemoteEndpointInventory> result = addChild<modelgbp::inv::RemoteEndpointInventory>(
202  CLASS_ID, getURI(), 2151284877ul, 141,
203  opflex::modb::URIBuilder(getURI()).addElement("InvRemoteEndpointInventory").build()
204  );
205  return result;
206  }
207 
216  void remove()
217  {
218  getTLMutator().remove(CLASS_ID, getURI());
219  }
220 
231  static void remove(opflex::ofcore::OFFramework& framework,
232  const opflex::modb::URI& uri)
233  {
234  MO::remove(framework, CLASS_ID, uri);
235  }
236 
247  static void remove(const opflex::modb::URI& uri)
248  {
249  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
250  }
251 
263  static void registerListener(
264  opflex::ofcore::OFFramework& framework,
265  opflex::modb::ObjectListener* listener)
266  {
267  opflex::modb::mointernal
268  ::MO::registerListener(framework, listener, CLASS_ID);
269  }
270 
282  static void registerListener(
283  opflex::modb::ObjectListener* listener)
284  {
285  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
286  }
287 
294  static void unregisterListener(
295  opflex::ofcore::OFFramework& framework,
296  opflex::modb::ObjectListener* listener)
297  {
298  opflex::modb::mointernal
299  ::MO::unregisterListener(framework, listener, CLASS_ID);
300  }
301 
308  static void unregisterListener(
309  opflex::modb::ObjectListener* listener)
310  {
311  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
312  }
313 
319  opflex::ofcore::OFFramework& framework,
320  const opflex::modb::URI& uri,
321  const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
322  : MO(framework, CLASS_ID, uri, oi) { }
323 }; // class Universe
324 
325 } // namespace inv
326 } // namespace modelgbp
327 #endif // GI_INV_UNIVERSE_HPP
static void registerListener(opflex::modb::ObjectListener *listener)
Register a listener that will get called for changes related to this class with the default framework...
Definition: inv/Universe.hpp:282
static void registerListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Register a listener that will get called for changes related to this class.
Definition: inv/Universe.hpp:263
boost::optional< OF_SHARED_PTR< modelgbp::inv::LocalEndpointInventory > > resolveInvLocalEndpointInventory(const std::string &invLocalEndpointInventoryName)
Retrieve the child object with the specified naming properties.
Definition: inv/Universe.hpp:124
Definition: inv/Universe.hpp:29
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: inv/Universe.hpp:308
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Universe > > resolve(opflex::ofcore::OFFramework &framework)
Retrieve an instance of Universe from the managed object store by constructing its URI from the path ...
Definition: inv/Universe.hpp:88
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Universe > > resolve()
Retrieve an instance of Universe from the default managed object store by constructing its URI from t...
Definition: inv/Universe.hpp:107
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for Universe.
Definition: inv/Universe.hpp:37
OF_SHARED_PTR< modelgbp::inv::RemoteEndpointInventory > addInvRemoteEndpointInventory()
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: inv/Universe.hpp:198
static boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteEndpointInventory > > resolve()
Retrieve an instance of RemoteEndpointInventory from the default managed object store by constructing...
Definition: RemoteEndpointInventory.hpp:107
static boost::optional< OF_SHARED_PTR< modelgbp::inv::LocalEndpointInventory > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of LocalEndpointInventory from the managed object store.
Definition: LocalEndpointInventory.hpp:106
Universe(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of Universe.
Definition: inv/Universe.hpp:318
void resolveInvLocalEndpointInventory(std::vector< OF_SHARED_PTR< modelgbp::inv::LocalEndpointInventory > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::inv::LocalEndpointInventory.
Definition: inv/Universe.hpp:167
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: inv/Universe.hpp:294
boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteEndpointInventory > > resolveInvRemoteEndpointInventory()
Retrieve the child object with the specified naming properties.
Definition: inv/Universe.hpp:182
OF_SHARED_PTR< modelgbp::inv::LocalEndpointInventory > addInvLocalEndpointInventory(const std::string &invLocalEndpointInventoryName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: inv/Universe.hpp:142
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Universe > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Universe from the managed object store.
Definition: inv/Universe.hpp:50
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Universe > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of Universe from the managed object store using the default framework instance...
Definition: inv/Universe.hpp:68