modelgbp Generated OpFlex Model  1.2.0
RouteTargetDef.hpp
1 
10 #pragma once
11 #ifndef GI_DCI_ROUTETARGETDEF_HPP
12 #define GI_DCI_ROUTETARGETDEF_HPP
13 
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
17 
18 namespace modelgbp {
19 namespace dci {
20 
22  : public opflex::modb::mointernal::MO
23 {
24 public:
25 
29  static const opflex::modb::class_id_t CLASS_ID = 75;
30 
35  bool isNameSet()
36  {
37  return getObjectInstance().isSet(2457601ul, opflex::modb::PropertyInfo::STRING);
38  }
39 
44  boost::optional<const std::string&> getName()
45  {
46  if (isNameSet())
47  return getObjectInstance().getString(2457601ul);
48  return boost::none;
49  }
50 
56  const std::string& getName(const std::string& defaultValue)
57  {
58  return getName().get_value_or(defaultValue);
59  }
60 
69  modelgbp::dci::RouteTargetDef& setName(const std::string& newValue)
70  {
71  getTLMutator().modify(getClassId(), getURI())->setString(2457601ul, newValue);
72  return *this;
73  }
74 
82  {
83  getTLMutator().modify(getClassId(), getURI())->unset(2457601ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
84  return *this;
85  }
86 
91  bool isRtASSet()
92  {
93  return getObjectInstance().isSet(2457604ul, opflex::modb::PropertyInfo::U64);
94  }
95 
100  boost::optional<uint16_t> getRtAS()
101  {
102  if (isRtASSet())
103  return (uint16_t)getObjectInstance().getUInt64(2457604ul);
104  return boost::none;
105  }
106 
112  uint16_t getRtAS(uint16_t defaultValue)
113  {
114  return getRtAS().get_value_or(defaultValue);
115  }
116 
126  {
127  getTLMutator().modify(getClassId(), getURI())->setUInt64(2457604ul, newValue);
128  return *this;
129  }
130 
138  {
139  getTLMutator().modify(getClassId(), getURI())->unset(2457604ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
140  return *this;
141  }
142 
147  bool isRtNNSet()
148  {
149  return getObjectInstance().isSet(2457605ul, opflex::modb::PropertyInfo::U64);
150  }
151 
156  boost::optional<uint32_t> getRtNN()
157  {
158  if (isRtNNSet())
159  return (uint32_t)getObjectInstance().getUInt64(2457605ul);
160  return boost::none;
161  }
162 
168  uint32_t getRtNN(uint32_t defaultValue)
169  {
170  return getRtNN().get_value_or(defaultValue);
171  }
172 
182  {
183  getTLMutator().modify(getClassId(), getURI())->setUInt64(2457605ul, newValue);
184  return *this;
185  }
186 
194  {
195  getTLMutator().modify(getClassId(), getURI())->unset(2457605ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
196  return *this;
197  }
198 
204  {
205  return getObjectInstance().isSet(2457602ul, opflex::modb::PropertyInfo::ENUM8);
206  }
207 
212  boost::optional<const uint8_t> getTargetAf()
213  {
214  if (isTargetAfSet())
215  return (const uint8_t)getObjectInstance().getUInt64(2457602ul);
216  return boost::none;
217  }
218 
224  const uint8_t getTargetAf(const uint8_t defaultValue)
225  {
226  return getTargetAf().get_value_or(defaultValue);
227  }
228 
238  {
239  getTLMutator().modify(getClassId(), getURI())->setUInt64(2457602ul, newValue);
240  return *this;
241  }
242 
250  {
251  getTLMutator().modify(getClassId(), getURI())->unset(2457602ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
252  return *this;
253  }
254 
259  bool isTypeSet()
260  {
261  return getObjectInstance().isSet(2457603ul, opflex::modb::PropertyInfo::ENUM8);
262  }
263 
268  boost::optional<const uint8_t> getType()
269  {
270  if (isTypeSet())
271  return (const uint8_t)getObjectInstance().getUInt64(2457603ul);
272  return boost::none;
273  }
274 
280  const uint8_t getType(const uint8_t defaultValue)
281  {
282  return getType().get_value_or(defaultValue);
283  }
284 
293  modelgbp::dci::RouteTargetDef& setType(const uint8_t newValue)
294  {
295  getTLMutator().modify(getClassId(), getURI())->setUInt64(2457603ul, newValue);
296  return *this;
297  }
298 
306  {
307  getTLMutator().modify(getClassId(), getURI())->unset(2457603ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
308  return *this;
309  }
310 
322  static boost::optional<boost::shared_ptr<modelgbp::dci::RouteTargetDef> > resolve(
323  opflex::ofcore::OFFramework& framework,
324  const opflex::modb::URI& uri)
325  {
326  return opflex::modb::mointernal::MO::resolve<modelgbp::dci::RouteTargetDef>(framework, CLASS_ID, uri);
327  }
328 
340  static boost::optional<boost::shared_ptr<modelgbp::dci::RouteTargetDef> > resolve(
341  const opflex::modb::URI& uri)
342  {
343  return opflex::modb::mointernal::MO::resolve<modelgbp::dci::RouteTargetDef>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
344  }
345 
368  static boost::optional<boost::shared_ptr<modelgbp::dci::RouteTargetDef> > resolve(
369  opflex::ofcore::OFFramework& framework,
370  const std::string& policySpaceName,
371  const std::string& gbpRoutingDomainName,
372  const std::string& dciRouteTargetPdefName,
373  const std::string& dciRouteTargetDefName)
374  {
375  return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpRoutingDomain").addElement(gbpRoutingDomainName).addElement("DciRouteTargetPdef").addElement(dciRouteTargetPdefName).addElement("DciRouteTargetDef").addElement(dciRouteTargetDefName).build());
376  }
377 
399  static boost::optional<boost::shared_ptr<modelgbp::dci::RouteTargetDef> > resolve(
400  const std::string& policySpaceName,
401  const std::string& gbpRoutingDomainName,
402  const std::string& dciRouteTargetPdefName,
403  const std::string& dciRouteTargetDefName)
404  {
405  return resolve(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpRoutingDomainName,dciRouteTargetPdefName,dciRouteTargetDefName);
406  }
407 
416  void remove()
417  {
418  getTLMutator().remove(CLASS_ID, getURI());
419  }
420 
431  static void remove(opflex::ofcore::OFFramework& framework,
432  const opflex::modb::URI& uri)
433  {
434  MO::remove(framework, CLASS_ID, uri);
435  }
436 
447  static void remove(const opflex::modb::URI& uri)
448  {
449  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
450  }
451 
472  static void remove(
473  opflex::ofcore::OFFramework& framework,
474  const std::string& policySpaceName,
475  const std::string& gbpRoutingDomainName,
476  const std::string& dciRouteTargetPdefName,
477  const std::string& dciRouteTargetDefName)
478  {
479  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpRoutingDomain").addElement(gbpRoutingDomainName).addElement("DciRouteTargetPdef").addElement(dciRouteTargetPdefName).addElement("DciRouteTargetDef").addElement(dciRouteTargetDefName).build());
480  }
481 
502  static void remove(
503  const std::string& policySpaceName,
504  const std::string& gbpRoutingDomainName,
505  const std::string& dciRouteTargetPdefName,
506  const std::string& dciRouteTargetDefName)
507  {
508  remove(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpRoutingDomainName,dciRouteTargetPdefName,dciRouteTargetDefName);
509  }
510 
522  static void registerListener(
523  opflex::ofcore::OFFramework& framework,
524  opflex::modb::ObjectListener* listener)
525  {
526  opflex::modb::mointernal
527  ::MO::registerListener(framework, listener, CLASS_ID);
528  }
529 
541  static void registerListener(
542  opflex::modb::ObjectListener* listener)
543  {
544  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
545  }
546 
553  static void unregisterListener(
554  opflex::ofcore::OFFramework& framework,
555  opflex::modb::ObjectListener* listener)
556  {
557  opflex::modb::mointernal
558  ::MO::unregisterListener(framework, listener, CLASS_ID);
559  }
560 
567  static void unregisterListener(
568  opflex::modb::ObjectListener* listener)
569  {
570  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
571  }
572 
578  opflex::ofcore::OFFramework& framework,
579  const opflex::modb::URI& uri,
580  const boost::shared_ptr<const opflex::modb::mointernal::ObjectInstance>& oi)
581  : MO(framework, CLASS_ID, uri, oi) { }
582 }; // class RouteTargetDef
583 
584 } // namespace dci
585 } // namespace modelgbp
586 #endif // GI_DCI_ROUTETARGETDEF_HPP
const uint8_t getType(const uint8_t defaultValue)
Get the value of type if set, otherwise the value of default passed in.
Definition: RouteTargetDef.hpp:280
bool isNameSet()
Check whether name has been set.
Definition: RouteTargetDef.hpp:35
modelgbp::dci::RouteTargetDef & unsetName()
Unset name in the currently-active mutator.
Definition: RouteTargetDef.hpp:81
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: RouteTargetDef.hpp:522
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: RouteTargetDef.hpp:56
static boost::optional< boost::shared_ptr< modelgbp::dci::RouteTargetDef > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of RouteTargetDef from the managed object store using the default framework inst...
Definition: RouteTargetDef.hpp:340
modelgbp::dci::RouteTargetDef & unsetTargetAf()
Unset targetAf in the currently-active mutator.
Definition: RouteTargetDef.hpp:249
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: RouteTargetDef.hpp:44
RouteTargetDef(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const boost::shared_ptr< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of RouteTargetDef.
Definition: RouteTargetDef.hpp:577
modelgbp::dci::RouteTargetDef & setTargetAf(const uint8_t newValue)
Set targetAf to the specified value in the currently-active mutator.
Definition: RouteTargetDef.hpp:237
modelgbp::dci::RouteTargetDef & setType(const uint8_t newValue)
Set type to the specified value in the currently-active mutator.
Definition: RouteTargetDef.hpp:293
static boost::optional< boost::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:322
bool isRtNNSet()
Check whether rtNN has been set.
Definition: RouteTargetDef.hpp:147
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: RouteTargetDef.hpp:567
boost::optional< uint16_t > getRtAS()
Get the value of rtAS if it has been set.
Definition: RouteTargetDef.hpp:100
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: RouteTargetDef.hpp:553
boost::optional< const uint8_t > getTargetAf()
Get the value of targetAf if it has been set.
Definition: RouteTargetDef.hpp:212
modelgbp::dci::RouteTargetDef & setRtAS(uint16_t newValue)
Set rtAS to the specified value in the currently-active mutator.
Definition: RouteTargetDef.hpp:125
bool isTargetAfSet()
Check whether targetAf has been set.
Definition: RouteTargetDef.hpp:203
modelgbp::dci::RouteTargetDef & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: RouteTargetDef.hpp:69
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for RouteTargetDef.
Definition: RouteTargetDef.hpp:29
modelgbp::dci::RouteTargetDef & unsetRtAS()
Unset rtAS in the currently-active mutator.
Definition: RouteTargetDef.hpp:137
const uint8_t getTargetAf(const uint8_t defaultValue)
Get the value of targetAf if set, otherwise the value of default passed in.
Definition: RouteTargetDef.hpp:224
boost::optional< const uint8_t > getType()
Get the value of type if it has been set.
Definition: RouteTargetDef.hpp:268
boost::optional< uint32_t > getRtNN()
Get the value of rtNN if it has been set.
Definition: RouteTargetDef.hpp:156
modelgbp::dci::RouteTargetDef & unsetRtNN()
Unset rtNN in the currently-active mutator.
Definition: RouteTargetDef.hpp:193
Definition: RouteTargetDef.hpp:21
bool isRtASSet()
Check whether rtAS has been set.
Definition: RouteTargetDef.hpp:91
modelgbp::dci::RouteTargetDef & unsetType()
Unset type in the currently-active mutator.
Definition: RouteTargetDef.hpp:305
static boost::optional< boost::shared_ptr< modelgbp::dci::RouteTargetDef > > resolve(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpRoutingDomainName, const std::string &dciRouteTargetPdefName, const std::string &dciRouteTargetDefName)
Retrieve an instance of RouteTargetDef from the managed object store by constructing its URI from the...
Definition: RouteTargetDef.hpp:368
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: RouteTargetDef.hpp:541
bool isTypeSet()
Check whether type has been set.
Definition: RouteTargetDef.hpp:259
modelgbp::dci::RouteTargetDef & setRtNN(uint32_t newValue)
Set rtNN to the specified value in the currently-active mutator.
Definition: RouteTargetDef.hpp:181
uint16_t getRtAS(uint16_t defaultValue)
Get the value of rtAS if set, otherwise the value of default passed in.
Definition: RouteTargetDef.hpp:112
static boost::optional< boost::shared_ptr< modelgbp::dci::RouteTargetDef > > resolve(const std::string &policySpaceName, const std::string &gbpRoutingDomainName, const std::string &dciRouteTargetPdefName, const std::string &dciRouteTargetDefName)
Retrieve an instance of RouteTargetDef from the default managed object store by constructing its URI ...
Definition: RouteTargetDef.hpp:399
SOME COPYRIGHT.
Definition: OpcodeEnumT.hpp:12
uint32_t getRtNN(uint32_t defaultValue)
Get the value of rtNN if set, otherwise the value of default passed in.
Definition: RouteTargetDef.hpp:168