modelgbp Generated OpFlex Model 1.7.0
RouteTargetPdef.hpp
1
10#pragma once
11#ifndef GI_DCI_ROUTETARGETPDEF_HPP
12#define GI_DCI_ROUTETARGETPDEF_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/RouteTargetDef)
19 */
20#include "modelgbp/dci/RouteTargetDef.hpp"
21
22namespace modelgbp {
23namespace dci {
24
26 : public opflex::modb::mointernal::MO
27{
28public:
29
33 static const opflex::modb::class_id_t CLASS_ID = 91;
34
39 bool isAfSet()
40 {
41 return getObjectInstance().isSet(2981890ul, opflex::modb::PropertyInfo::ENUM8);
42 }
43
48 boost::optional<const uint8_t> getAf()
49 {
50 if (isAfSet())
51 return (const uint8_t)getObjectInstance().getUInt64(2981890ul);
52 return boost::none;
53 }
54
60 const uint8_t getAf(const uint8_t defaultValue)
61 {
62 return getAf().get_value_or(defaultValue);
63 }
64
73 modelgbp::dci::RouteTargetPdef& setAf(const uint8_t newValue)
74 {
75 getTLMutator().modify(getClassId(), getURI())->setUInt64(2981890ul, newValue);
76 return *this;
77 }
78
86 {
87 getTLMutator().modify(getClassId(), getURI())->unset(2981890ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
88 return *this;
89 }
90
95 bool isNameSet()
96 {
97 return getObjectInstance().isSet(2981889ul, opflex::modb::PropertyInfo::STRING);
98 }
99
104 boost::optional<const std::string&> getName()
105 {
106 if (isNameSet())
107 return getObjectInstance().getString(2981889ul);
108 return boost::none;
109 }
110
116 const std::string& getName(const std::string& defaultValue)
117 {
118 return getName().get_value_or(defaultValue);
119 }
120
129 modelgbp::dci::RouteTargetPdef& setName(const std::string& newValue)
130 {
131 getTLMutator().modify(getClassId(), getURI())->setString(2981889ul, newValue);
132 return *this;
133 }
134
142 {
143 getTLMutator().modify(getClassId(), getURI())->unset(2981889ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
144 return *this;
145 }
146
158 static boost::optional<OF_SHARED_PTR<modelgbp::dci::RouteTargetPdef> > resolve(
159 opflex::ofcore::OFFramework& framework,
160 const opflex::modb::URI& uri)
161 {
162 return opflex::modb::mointernal::MO::resolve<modelgbp::dci::RouteTargetPdef>(framework, CLASS_ID, uri);
163 }
164
176 static boost::optional<OF_SHARED_PTR<modelgbp::dci::RouteTargetPdef> > resolve(
177 const opflex::modb::URI& uri)
178 {
179 return opflex::modb::mointernal::MO::resolve<modelgbp::dci::RouteTargetPdef>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
180 }
181
202 static boost::optional<OF_SHARED_PTR<modelgbp::dci::RouteTargetPdef> > resolve(
203 opflex::ofcore::OFFramework& framework,
204 const std::string& policySpaceName,
205 const std::string& gbpRoutingDomainName,
206 const std::string& dciRouteTargetPdefName)
207 {
208 return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpRoutingDomain").addElement(gbpRoutingDomainName).addElement("DciRouteTargetPdef").addElement(dciRouteTargetPdefName).build());
209 }
210
230 static boost::optional<OF_SHARED_PTR<modelgbp::dci::RouteTargetPdef> > resolve(
231 const std::string& policySpaceName,
232 const std::string& gbpRoutingDomainName,
233 const std::string& dciRouteTargetPdefName)
234 {
235 return resolve(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpRoutingDomainName,dciRouteTargetPdefName);
236 }
237
249 boost::optional<OF_SHARED_PTR<modelgbp::dci::RouteTargetDef> > resolveDciRouteTargetDef(
250 const std::string& dciRouteTargetDefName)
251 {
252 return modelgbp::dci::RouteTargetDef::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("DciRouteTargetDef").addElement(dciRouteTargetDefName).build());
253 }
254
267 OF_SHARED_PTR<modelgbp::dci::RouteTargetDef> addDciRouteTargetDef(
268 const std::string& dciRouteTargetDefName)
269 {
270 OF_SHARED_PTR<modelgbp::dci::RouteTargetDef> result = addChild<modelgbp::dci::RouteTargetDef>(
271 CLASS_ID, getURI(), 2150465628ul, 92,
272 opflex::modb::URIBuilder(getURI()).addElement("DciRouteTargetDef").addElement(dciRouteTargetDefName).build()
273 );
274 result->setName(dciRouteTargetDefName);
275 return result;
276 }
277
292 void resolveDciRouteTargetDef(/* out */ std::vector<OF_SHARED_PTR<modelgbp::dci::RouteTargetDef> >& out)
293 {
294 opflex::modb::mointernal::MO::resolveChildren<modelgbp::dci::RouteTargetDef>(
295 getFramework(), CLASS_ID, getURI(), 2150465628ul, 92, out);
296 }
297
306 void remove()
307 {
308 getTLMutator().remove(CLASS_ID, getURI());
309 }
310
321 static void remove(opflex::ofcore::OFFramework& framework,
322 const opflex::modb::URI& uri)
323 {
324 MO::remove(framework, CLASS_ID, uri);
325 }
326
337 static void remove(const opflex::modb::URI& uri)
338 {
339 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
340 }
341
360 static void remove(
361 opflex::ofcore::OFFramework& framework,
362 const std::string& policySpaceName,
363 const std::string& gbpRoutingDomainName,
364 const std::string& dciRouteTargetPdefName)
365 {
366 MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpRoutingDomain").addElement(gbpRoutingDomainName).addElement("DciRouteTargetPdef").addElement(dciRouteTargetPdefName).build());
367 }
368
387 static void remove(
388 const std::string& policySpaceName,
389 const std::string& gbpRoutingDomainName,
390 const std::string& dciRouteTargetPdefName)
391 {
392 remove(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpRoutingDomainName,dciRouteTargetPdefName);
393 }
394
406 static void registerListener(
407 opflex::ofcore::OFFramework& framework,
408 opflex::modb::ObjectListener* listener)
409 {
410 opflex::modb::mointernal
411 ::MO::registerListener(framework, listener, CLASS_ID);
412 }
413
425 static void registerListener(
426 opflex::modb::ObjectListener* listener)
427 {
428 registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
429 }
430
438 opflex::ofcore::OFFramework& framework,
439 opflex::modb::ObjectListener* listener)
440 {
441 opflex::modb::mointernal
442 ::MO::unregisterListener(framework, listener, CLASS_ID);
443 }
444
452 opflex::modb::ObjectListener* listener)
453 {
454 unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
455 }
456
462 opflex::ofcore::OFFramework& framework,
463 const opflex::modb::URI& uri,
464 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
465 : MO(framework, CLASS_ID, uri, oi) { }
466}; // class RouteTargetPdef
467
468} // namespace dci
469} // namespace modelgbp
470#endif // GI_DCI_ROUTETARGETPDEF_HPP
static boost::optional< OF_SHARED_PTR< modelgbp::dci::RouteTargetDef > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of RouteTargetDef from the managed object store.
Definition RouteTargetDef.hpp:378
Definition RouteTargetPdef.hpp:27
OF_SHARED_PTR< modelgbp::dci::RouteTargetDef > addDciRouteTargetDef(const std::string &dciRouteTargetDefName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition RouteTargetPdef.hpp:267
modelgbp::dci::RouteTargetPdef & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition RouteTargetPdef.hpp:129
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 RouteTargetPdef.hpp:406
static boost::optional< OF_SHARED_PTR< modelgbp::dci::RouteTargetPdef > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of RouteTargetPdef from the managed object store using the default framework ins...
Definition RouteTargetPdef.hpp:176
boost::optional< OF_SHARED_PTR< modelgbp::dci::RouteTargetDef > > resolveDciRouteTargetDef(const std::string &dciRouteTargetDefName)
Retrieve the child object with the specified naming properties.
Definition RouteTargetPdef.hpp:249
modelgbp::dci::RouteTargetPdef & unsetAf()
Unset af in the currently-active mutator.
Definition RouteTargetPdef.hpp:85
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition RouteTargetPdef.hpp:104
static void remove(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Remove the RouteTargetPdef object with the specified URI using the currently-active mutator.
Definition RouteTargetPdef.hpp:321
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition RouteTargetPdef.hpp:451
modelgbp::dci::RouteTargetPdef & setAf(const uint8_t newValue)
Set af to the specified value in the currently-active mutator.
Definition RouteTargetPdef.hpp:73
bool isNameSet()
Check whether name has been set.
Definition RouteTargetPdef.hpp:95
bool isAfSet()
Check whether af has been set.
Definition RouteTargetPdef.hpp:39
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 RouteTargetPdef.hpp:425
static boost::optional< OF_SHARED_PTR< modelgbp::dci::RouteTargetPdef > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of RouteTargetPdef from the managed object store.
Definition RouteTargetPdef.hpp:158
boost::optional< const uint8_t > getAf()
Get the value of af if it has been set.
Definition RouteTargetPdef.hpp:48
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition RouteTargetPdef.hpp:116
static void remove(const std::string &policySpaceName, const std::string &gbpRoutingDomainName, const std::string &dciRouteTargetPdefName)
Remove the RouteTargetPdef object with the specified path elements from the managed object store usin...
Definition RouteTargetPdef.hpp:387
static boost::optional< OF_SHARED_PTR< modelgbp::dci::RouteTargetPdef > > resolve(const std::string &policySpaceName, const std::string &gbpRoutingDomainName, const std::string &dciRouteTargetPdefName)
Retrieve an instance of RouteTargetPdef from the default managed object store by constructing its URI...
Definition RouteTargetPdef.hpp:230
void resolveDciRouteTargetDef(std::vector< OF_SHARED_PTR< modelgbp::dci::RouteTargetDef > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::dci::RouteTargetDef.
Definition RouteTargetPdef.hpp:292
RouteTargetPdef(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of RouteTargetPdef.
Definition RouteTargetPdef.hpp:461
static void remove(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpRoutingDomainName, const std::string &dciRouteTargetPdefName)
Remove the RouteTargetPdef object with the specified path elements from the managed object store.
Definition RouteTargetPdef.hpp:360
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition RouteTargetPdef.hpp:437
modelgbp::dci::RouteTargetPdef & unsetName()
Unset name in the currently-active mutator.
Definition RouteTargetPdef.hpp:141
static boost::optional< OF_SHARED_PTR< modelgbp::dci::RouteTargetPdef > > resolve(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpRoutingDomainName, const std::string &dciRouteTargetPdefName)
Retrieve an instance of RouteTargetPdef from the managed object store by constructing its URI from th...
Definition RouteTargetPdef.hpp:202
static void remove(const opflex::modb::URI &uri)
Remove the RouteTargetPdef object with the specified URI using the currently-active mutator and the d...
Definition RouteTargetPdef.hpp:337
void remove()
Remove this instance using the currently-active mutator.
Definition RouteTargetPdef.hpp:306
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for RouteTargetPdef.
Definition RouteTargetPdef.hpp:33
const uint8_t getAf(const uint8_t defaultValue)
Get the value of af if set, otherwise the value of default passed in.
Definition RouteTargetPdef.hpp:60
SOME COPYRIGHT.
Definition OpcodeEnumT.hpp:12