modelgbp Generated OpFlex Model 1.7.0
Domain.hpp
1
10#pragma once
11#ifndef GI_DCI_DOMAIN_HPP
12#define GI_DCI_DOMAIN_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/DomainToGbpRoutingDomainRSrc)
19 */
20#include "modelgbp/dci/DomainToGbpRoutingDomainRSrc.hpp"
21
22namespace modelgbp {
23namespace dci {
24
25class Domain
26 : public opflex::modb::mointernal::MO
27{
28public:
29
33 static const opflex::modb::class_id_t CLASS_ID = 87;
34
39 bool isNameSet()
40 {
41 return getObjectInstance().isSet(2850817ul, opflex::modb::PropertyInfo::STRING);
42 }
43
48 boost::optional<const std::string&> getName()
49 {
50 if (isNameSet())
51 return getObjectInstance().getString(2850817ul);
52 return boost::none;
53 }
54
60 const std::string& getName(const std::string& defaultValue)
61 {
62 return getName().get_value_or(defaultValue);
63 }
64
73 modelgbp::dci::Domain& setName(const std::string& newValue)
74 {
75 getTLMutator().modify(getClassId(), getURI())->setString(2850817ul, newValue);
76 return *this;
77 }
78
86 {
87 getTLMutator().modify(getClassId(), getURI())->unset(2850817ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
88 return *this;
89 }
90
102 static boost::optional<OF_SHARED_PTR<modelgbp::dci::Domain> > resolve(
103 opflex::ofcore::OFFramework& framework,
104 const opflex::modb::URI& uri)
105 {
106 return opflex::modb::mointernal::MO::resolve<modelgbp::dci::Domain>(framework, CLASS_ID, uri);
107 }
108
120 static boost::optional<OF_SHARED_PTR<modelgbp::dci::Domain> > resolve(
121 const opflex::modb::URI& uri)
122 {
123 return opflex::modb::mointernal::MO::resolve<modelgbp::dci::Domain>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
124 }
125
142 static boost::optional<OF_SHARED_PTR<modelgbp::dci::Domain> > resolve(
143 opflex::ofcore::OFFramework& framework,
144 const std::string& dciDomainName)
145 {
146 return resolve(framework,opflex::modb::URIBuilder().addElement("DciUniverse").addElement("DciDomain").addElement(dciDomainName).build());
147 }
148
164 static boost::optional<OF_SHARED_PTR<modelgbp::dci::Domain> > resolve(
165 const std::string& dciDomainName)
166 {
167 return resolve(opflex::ofcore::OFFramework::defaultInstance(),dciDomainName);
168 }
169
183 boost::optional<OF_SHARED_PTR<modelgbp::dci::DomainToGbpRoutingDomainRSrc> > resolveDciDomainToGbpRoutingDomainRSrc(
184 const std::string& dciDomainToGbpRoutingDomainRSrcTargetName)
185 {
186 opflex::modb::class_id_t dciDomainToGbpRoutingDomainRSrcTargetClass = 190;
187 return modelgbp::dci::DomainToGbpRoutingDomainRSrc::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("DciDomainToGbpRoutingDomainRSrc").addElement(dciDomainToGbpRoutingDomainRSrcTargetClass).addElement(dciDomainToGbpRoutingDomainRSrcTargetName).build());
188 }
189
204 OF_SHARED_PTR<modelgbp::dci::DomainToGbpRoutingDomainRSrc> addDciDomainToGbpRoutingDomainRSrc(
205 const std::string& dciDomainToGbpRoutingDomainRSrcTargetName)
206 {
207 opflex::modb::class_id_t dciDomainToGbpRoutingDomainRSrcTargetClass = 190;
208 OF_SHARED_PTR<modelgbp::dci::DomainToGbpRoutingDomainRSrc> result = addChild<modelgbp::dci::DomainToGbpRoutingDomainRSrc>(
209 CLASS_ID, getURI(), 2150334552ul, 88,
210 opflex::modb::URIBuilder(getURI()).addElement("DciDomainToGbpRoutingDomainRSrc").addElement(dciDomainToGbpRoutingDomainRSrcTargetClass).addElement(dciDomainToGbpRoutingDomainRSrcTargetName).build()
211 );
212 result->setTargetRoutingDomain(opflex::modb::URI(dciDomainToGbpRoutingDomainRSrcTargetName));
213 return result;
214 }
215
230 void resolveDciDomainToGbpRoutingDomainRSrc(/* out */ std::vector<OF_SHARED_PTR<modelgbp::dci::DomainToGbpRoutingDomainRSrc> >& out)
231 {
232 opflex::modb::mointernal::MO::resolveChildren<modelgbp::dci::DomainToGbpRoutingDomainRSrc>(
233 getFramework(), CLASS_ID, getURI(), 2150334552ul, 88, out);
234 }
235
244 void remove()
245 {
246 getTLMutator().remove(CLASS_ID, getURI());
247 }
248
259 static void remove(opflex::ofcore::OFFramework& framework,
260 const opflex::modb::URI& uri)
261 {
262 MO::remove(framework, CLASS_ID, uri);
263 }
264
275 static void remove(const opflex::modb::URI& uri)
276 {
277 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
278 }
279
294 static void remove(
295 opflex::ofcore::OFFramework& framework,
296 const std::string& dciDomainName)
297 {
298 MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("DciUniverse").addElement("DciDomain").addElement(dciDomainName).build());
299 }
300
315 static void remove(
316 const std::string& dciDomainName)
317 {
318 remove(opflex::ofcore::OFFramework::defaultInstance(),dciDomainName);
319 }
320
332 static void registerListener(
333 opflex::ofcore::OFFramework& framework,
334 opflex::modb::ObjectListener* listener)
335 {
336 opflex::modb::mointernal
337 ::MO::registerListener(framework, listener, CLASS_ID);
338 }
339
351 static void registerListener(
352 opflex::modb::ObjectListener* listener)
353 {
354 registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
355 }
356
364 opflex::ofcore::OFFramework& framework,
365 opflex::modb::ObjectListener* listener)
366 {
367 opflex::modb::mointernal
368 ::MO::unregisterListener(framework, listener, CLASS_ID);
369 }
370
378 opflex::modb::ObjectListener* listener)
379 {
380 unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
381 }
382
388 opflex::ofcore::OFFramework& framework,
389 const opflex::modb::URI& uri,
390 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
391 : MO(framework, CLASS_ID, uri, oi) { }
392}; // class Domain
393
394} // namespace dci
395} // namespace modelgbp
396#endif // GI_DCI_DOMAIN_HPP
static boost::optional< OF_SHARED_PTR< modelgbp::dci::DomainToGbpRoutingDomainRSrc > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of DomainToGbpRoutingDomainRSrc from the managed object store.
Definition DomainToGbpRoutingDomainRSrc.hpp:257
Definition Domain.hpp:27
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
void remove()
Remove this instance using the currently-active mutator.
Definition Domain.hpp:244
Domain(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of Domain.
Definition Domain.hpp:387
modelgbp::dci::Domain & unsetName()
Unset name in the currently-active mutator.
Definition Domain.hpp:85
static boost::optional< OF_SHARED_PTR< modelgbp::dci::Domain > > resolve(const std::string &dciDomainName)
Retrieve an instance of Domain from the default managed object store by constructing its URI from the...
Definition Domain.hpp:164
static void remove(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Remove the Domain object with the specified URI using the currently-active mutator.
Definition Domain.hpp:259
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition Domain.hpp:60
boost::optional< OF_SHARED_PTR< modelgbp::dci::DomainToGbpRoutingDomainRSrc > > resolveDciDomainToGbpRoutingDomainRSrc(const std::string &dciDomainToGbpRoutingDomainRSrcTargetName)
Retrieve the child object with the specified naming properties.
Definition Domain.hpp:183
OF_SHARED_PTR< modelgbp::dci::DomainToGbpRoutingDomainRSrc > addDciDomainToGbpRoutingDomainRSrc(const std::string &dciDomainToGbpRoutingDomainRSrcTargetName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition Domain.hpp:204
modelgbp::dci::Domain & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition Domain.hpp:73
static void remove(const opflex::modb::URI &uri)
Remove the Domain object with the specified URI using the currently-active mutator and the default fr...
Definition Domain.hpp:275
void resolveDciDomainToGbpRoutingDomainRSrc(std::vector< OF_SHARED_PTR< modelgbp::dci::DomainToGbpRoutingDomainRSrc > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::dci::DomainToGbpRoutingDomainRSr...
Definition Domain.hpp:230
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition Domain.hpp:377
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition Domain.hpp:363
static boost::optional< OF_SHARED_PTR< modelgbp::dci::Domain > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of Domain from the managed object store using the default framework instance.
Definition Domain.hpp:120
bool isNameSet()
Check whether name has been set.
Definition Domain.hpp:39
static boost::optional< OF_SHARED_PTR< modelgbp::dci::Domain > > resolve(opflex::ofcore::OFFramework &framework, const std::string &dciDomainName)
Retrieve an instance of Domain from the managed object store by constructing its URI from the path el...
Definition Domain.hpp:142
static void remove(const std::string &dciDomainName)
Remove the Domain object with the specified path elements from the managed object store using the def...
Definition Domain.hpp:315
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition Domain.hpp:48
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for Domain.
Definition Domain.hpp:33
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 Domain.hpp:332
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 Domain.hpp:351
static void remove(opflex::ofcore::OFFramework &framework, const std::string &dciDomainName)
Remove the Domain object with the specified path elements from the managed object store.
Definition Domain.hpp:294
SOME COPYRIGHT.
Definition OpcodeEnumT.hpp:12