modelgbp Generated OpFlex Model 1.7.0
dci/Universe.hpp
1
10#pragma once
11#ifndef GI_DCI_UNIVERSE_HPP
12#define GI_DCI_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(dci/EpFromUnivRTgt)
19 */
20#include "modelgbp/dci/EpFromUnivRTgt.hpp"
21/*
22 * contains: item:mclass(dci/Domain)
23 */
24#include "modelgbp/dci/Domain.hpp"
25
26namespace modelgbp {
27namespace dci {
28
30 : public opflex::modb::mointernal::MO
31{
32public:
33
37 static const opflex::modb::class_id_t CLASS_ID = 81;
38
43 bool isNameSet()
44 {
45 return getObjectInstance().isSet(2654209ul, opflex::modb::PropertyInfo::STRING);
46 }
47
52 boost::optional<const std::string&> getName()
53 {
54 if (isNameSet())
55 return getObjectInstance().getString(2654209ul);
56 return boost::none;
57 }
58
64 const std::string& getName(const std::string& defaultValue)
65 {
66 return getName().get_value_or(defaultValue);
67 }
68
77 modelgbp::dci::Universe& setName(const std::string& newValue)
78 {
79 getTLMutator().modify(getClassId(), getURI())->setString(2654209ul, newValue);
80 return *this;
81 }
82
90 {
91 getTLMutator().modify(getClassId(), getURI())->unset(2654209ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
92 return *this;
93 }
94
106 static boost::optional<OF_SHARED_PTR<modelgbp::dci::Universe> > resolve(
107 opflex::ofcore::OFFramework& framework,
108 const opflex::modb::URI& uri)
109 {
110 return opflex::modb::mointernal::MO::resolve<modelgbp::dci::Universe>(framework, CLASS_ID, uri);
111 }
112
124 static boost::optional<OF_SHARED_PTR<modelgbp::dci::Universe> > resolve(
125 const opflex::modb::URI& uri)
126 {
127 return opflex::modb::mointernal::MO::resolve<modelgbp::dci::Universe>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
128 }
129
144 static boost::optional<OF_SHARED_PTR<modelgbp::dci::Universe> > resolve(
145 opflex::ofcore::OFFramework& framework)
146 {
147 return resolve(framework,opflex::modb::URIBuilder().addElement("DciUniverse").build());
148 }
149
163 static boost::optional<OF_SHARED_PTR<modelgbp::dci::Universe> > resolve(
164 )
165 {
166 return resolve(opflex::ofcore::OFFramework::defaultInstance());
167 }
168
178 boost::optional<OF_SHARED_PTR<modelgbp::dci::EpFromUnivRTgt> > resolveDciEpFromUnivRTgt(
179 )
180 {
181 return modelgbp::dci::EpFromUnivRTgt::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("DciEpFromUnivRTgt").build());
182 }
183
194 OF_SHARED_PTR<modelgbp::dci::EpFromUnivRTgt> addDciEpFromUnivRTgt(
195 )
196 {
197 OF_SHARED_PTR<modelgbp::dci::EpFromUnivRTgt> result = addChild<modelgbp::dci::EpFromUnivRTgt>(
198 CLASS_ID, getURI(), 2150137941ul, 85,
199 opflex::modb::URIBuilder(getURI()).addElement("DciEpFromUnivRTgt").build()
200 );
201 return result;
202 }
203
215 boost::optional<OF_SHARED_PTR<modelgbp::dci::Domain> > resolveDciDomain(
216 const std::string& dciDomainName)
217 {
218 return modelgbp::dci::Domain::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("DciDomain").addElement(dciDomainName).build());
219 }
220
233 OF_SHARED_PTR<modelgbp::dci::Domain> addDciDomain(
234 const std::string& dciDomainName)
235 {
236 OF_SHARED_PTR<modelgbp::dci::Domain> result = addChild<modelgbp::dci::Domain>(
237 CLASS_ID, getURI(), 2150137943ul, 87,
238 opflex::modb::URIBuilder(getURI()).addElement("DciDomain").addElement(dciDomainName).build()
239 );
240 result->setName(dciDomainName);
241 return result;
242 }
243
258 void resolveDciDomain(/* out */ std::vector<OF_SHARED_PTR<modelgbp::dci::Domain> >& out)
259 {
260 opflex::modb::mointernal::MO::resolveChildren<modelgbp::dci::Domain>(
261 getFramework(), CLASS_ID, getURI(), 2150137943ul, 87, out);
262 }
263
272 void remove()
273 {
274 getTLMutator().remove(CLASS_ID, getURI());
275 }
276
287 static void remove(opflex::ofcore::OFFramework& framework,
288 const opflex::modb::URI& uri)
289 {
290 MO::remove(framework, CLASS_ID, uri);
291 }
292
303 static void remove(const opflex::modb::URI& uri)
304 {
305 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
306 }
307
319 static void registerListener(
320 opflex::ofcore::OFFramework& framework,
321 opflex::modb::ObjectListener* listener)
322 {
323 opflex::modb::mointernal
324 ::MO::registerListener(framework, listener, CLASS_ID);
325 }
326
338 static void registerListener(
339 opflex::modb::ObjectListener* listener)
340 {
341 registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
342 }
343
351 opflex::ofcore::OFFramework& framework,
352 opflex::modb::ObjectListener* listener)
353 {
354 opflex::modb::mointernal
355 ::MO::unregisterListener(framework, listener, CLASS_ID);
356 }
357
365 opflex::modb::ObjectListener* listener)
366 {
367 unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
368 }
369
375 opflex::ofcore::OFFramework& framework,
376 const opflex::modb::URI& uri,
377 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
378 : MO(framework, CLASS_ID, uri, oi) { }
379}; // class Universe
380
381} // namespace dci
382} // namespace modelgbp
383#endif // GI_DCI_UNIVERSE_HPP
static boost::optional< OF_SHARED_PTR< modelgbp::dci::Domain > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Domain from the managed object store.
Definition Domain.hpp:102
static boost::optional< OF_SHARED_PTR< modelgbp::dci::EpFromUnivRTgt > > resolve()
Retrieve an instance of EpFromUnivRTgt from the default managed object store by constructing its URI ...
Definition EpFromUnivRTgt.hpp:267
Definition dci/Universe.hpp:31
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 dci/Universe.hpp:338
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 dci/Universe.hpp:374
boost::optional< OF_SHARED_PTR< modelgbp::dci::Domain > > resolveDciDomain(const std::string &dciDomainName)
Retrieve the child object with the specified naming properties.
Definition dci/Universe.hpp:215
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition dci/Universe.hpp:350
boost::optional< OF_SHARED_PTR< modelgbp::dci::EpFromUnivRTgt > > resolveDciEpFromUnivRTgt()
Retrieve the child object with the specified naming properties.
Definition dci/Universe.hpp:178
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 dci/Universe.hpp:319
static boost::optional< OF_SHARED_PTR< modelgbp::dci::Universe > > resolve()
Retrieve an instance of Universe from the default managed object store by constructing its URI from t...
Definition dci/Universe.hpp:163
static void remove(const opflex::modb::URI &uri)
Remove the Universe object with the specified URI using the currently-active mutator and the default ...
Definition dci/Universe.hpp:303
void resolveDciDomain(std::vector< OF_SHARED_PTR< modelgbp::dci::Domain > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::dci::Domain.
Definition dci/Universe.hpp:258
static boost::optional< OF_SHARED_PTR< modelgbp::dci::Universe > > resolve(opflex::ofcore::OFFramework &framework)
Retrieve an instance of Universe from the managed object store by constructing its URI from the path ...
Definition dci/Universe.hpp:144
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition dci/Universe.hpp:52
modelgbp::dci::Universe & unsetName()
Unset name in the currently-active mutator.
Definition dci/Universe.hpp:89
OF_SHARED_PTR< modelgbp::dci::EpFromUnivRTgt > addDciEpFromUnivRTgt()
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition dci/Universe.hpp:194
modelgbp::dci::Universe & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition dci/Universe.hpp:77
OF_SHARED_PTR< modelgbp::dci::Domain > addDciDomain(const std::string &dciDomainName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition dci/Universe.hpp:233
void remove()
Remove this instance using the currently-active mutator.
Definition dci/Universe.hpp:272
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition dci/Universe.hpp:364
bool isNameSet()
Check whether name has been set.
Definition dci/Universe.hpp:43
static boost::optional< OF_SHARED_PTR< modelgbp::dci::Universe > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Universe from the managed object store.
Definition dci/Universe.hpp:106
static void remove(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Remove the Universe object with the specified URI using the currently-active mutator.
Definition dci/Universe.hpp:287
static boost::optional< OF_SHARED_PTR< modelgbp::dci::Universe > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of Universe from the managed object store using the default framework instance.
Definition dci/Universe.hpp:124
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition dci/Universe.hpp:64
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for Universe.
Definition dci/Universe.hpp:37
SOME COPYRIGHT.
Definition OpcodeEnumT.hpp:12