modelgbp Generated OpFlex Model  1.7.0
Subnet.hpp
1 
10 #pragma once
11 #ifndef GI_GBP_SUBNET_HPP
12 #define GI_GBP_SUBNET_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 gbp {
20 
21 class Subnet
22  : public opflex::modb::mointernal::MO
23 {
24 public:
25 
29  static const opflex::modb::class_id_t CLASS_ID = 195;
30 
35  bool isAddressSet()
36  {
37  return getObjectInstance().isSet(6389762ul, opflex::modb::PropertyInfo::STRING);
38  }
39 
44  boost::optional<const std::string&> getAddress()
45  {
46  if (isAddressSet())
47  return getObjectInstance().getString(6389762ul);
48  return boost::none;
49  }
50 
56  const std::string& getAddress(const std::string& defaultValue)
57  {
58  return getAddress().get_value_or(defaultValue);
59  }
60 
69  modelgbp::gbp::Subnet& setAddress(const std::string& newValue)
70  {
71  getTLMutator().modify(getClassId(), getURI())->setString(6389762ul, newValue);
72  return *this;
73  }
74 
82  {
83  getTLMutator().modify(getClassId(), getURI())->unset(6389762ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
84  return *this;
85  }
86 
92  {
93  return getObjectInstance().isSet(6389766ul, opflex::modb::PropertyInfo::U64);
94  }
95 
100  boost::optional<const uint8_t> getIpv6AdvAutonomousFlag()
101  {
103  return (const uint8_t)getObjectInstance().getUInt64(6389766ul);
104  return boost::none;
105  }
106 
112  const uint8_t getIpv6AdvAutonomousFlag(const uint8_t defaultValue)
113  {
114  return getIpv6AdvAutonomousFlag().get_value_or(defaultValue);
115  }
116 
126  {
127  getTLMutator().modify(getClassId(), getURI())->setUInt64(6389766ul, newValue);
128  return *this;
129  }
130 
138  {
139  getTLMutator().modify(getClassId(), getURI())->unset(6389766ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
140  return *this;
141  }
142 
148  {
149  return getObjectInstance().isSet(6389767ul, opflex::modb::PropertyInfo::U64);
150  }
151 
156  boost::optional<uint32_t> getIpv6AdvPreferredLifetime()
157  {
159  return (uint32_t)getObjectInstance().getUInt64(6389767ul);
160  return boost::none;
161  }
162 
168  uint32_t getIpv6AdvPreferredLifetime(uint32_t defaultValue)
169  {
170  return getIpv6AdvPreferredLifetime().get_value_or(defaultValue);
171  }
172 
182  {
183  getTLMutator().modify(getClassId(), getURI())->setUInt64(6389767ul, newValue);
184  return *this;
185  }
186 
194  {
195  getTLMutator().modify(getClassId(), getURI())->unset(6389767ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
196  return *this;
197  }
198 
204  {
205  return getObjectInstance().isSet(6389765ul, opflex::modb::PropertyInfo::U64);
206  }
207 
212  boost::optional<uint32_t> getIpv6AdvValidLifetime()
213  {
215  return (uint32_t)getObjectInstance().getUInt64(6389765ul);
216  return boost::none;
217  }
218 
224  uint32_t getIpv6AdvValidLifetime(uint32_t defaultValue)
225  {
226  return getIpv6AdvValidLifetime().get_value_or(defaultValue);
227  }
228 
238  {
239  getTLMutator().modify(getClassId(), getURI())->setUInt64(6389765ul, newValue);
240  return *this;
241  }
242 
250  {
251  getTLMutator().modify(getClassId(), getURI())->unset(6389765ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
252  return *this;
253  }
254 
259  bool isNameSet()
260  {
261  return getObjectInstance().isSet(6389761ul, opflex::modb::PropertyInfo::STRING);
262  }
263 
268  boost::optional<const std::string&> getName()
269  {
270  if (isNameSet())
271  return getObjectInstance().getString(6389761ul);
272  return boost::none;
273  }
274 
280  const std::string& getName(const std::string& defaultValue)
281  {
282  return getName().get_value_or(defaultValue);
283  }
284 
293  modelgbp::gbp::Subnet& setName(const std::string& newValue)
294  {
295  getTLMutator().modify(getClassId(), getURI())->setString(6389761ul, newValue);
296  return *this;
297  }
298 
306  {
307  getTLMutator().modify(getClassId(), getURI())->unset(6389761ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
308  return *this;
309  }
310 
316  {
317  return getObjectInstance().isSet(6389763ul, opflex::modb::PropertyInfo::U64);
318  }
319 
324  boost::optional<const uint8_t> getPrefixLen()
325  {
326  if (isPrefixLenSet())
327  return (const uint8_t)getObjectInstance().getUInt64(6389763ul);
328  return boost::none;
329  }
330 
336  const uint8_t getPrefixLen(const uint8_t defaultValue)
337  {
338  return getPrefixLen().get_value_or(defaultValue);
339  }
340 
349  modelgbp::gbp::Subnet& setPrefixLen(const uint8_t newValue)
350  {
351  getTLMutator().modify(getClassId(), getURI())->setUInt64(6389763ul, newValue);
352  return *this;
353  }
354 
362  {
363  getTLMutator().modify(getClassId(), getURI())->unset(6389763ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
364  return *this;
365  }
366 
372  {
373  return getObjectInstance().isSet(6389764ul, opflex::modb::PropertyInfo::STRING);
374  }
375 
380  boost::optional<const std::string&> getVirtualRouterIp()
381  {
382  if (isVirtualRouterIpSet())
383  return getObjectInstance().getString(6389764ul);
384  return boost::none;
385  }
386 
392  const std::string& getVirtualRouterIp(const std::string& defaultValue)
393  {
394  return getVirtualRouterIp().get_value_or(defaultValue);
395  }
396 
405  modelgbp::gbp::Subnet& setVirtualRouterIp(const std::string& newValue)
406  {
407  getTLMutator().modify(getClassId(), getURI())->setString(6389764ul, newValue);
408  return *this;
409  }
410 
418  {
419  getTLMutator().modify(getClassId(), getURI())->unset(6389764ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
420  return *this;
421  }
422 
434  static boost::optional<OF_SHARED_PTR<modelgbp::gbp::Subnet> > resolve(
435  opflex::ofcore::OFFramework& framework,
436  const opflex::modb::URI& uri)
437  {
438  return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::Subnet>(framework, CLASS_ID, uri);
439  }
440 
452  static boost::optional<OF_SHARED_PTR<modelgbp::gbp::Subnet> > resolve(
453  const opflex::modb::URI& uri)
454  {
455  return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::Subnet>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
456  }
457 
478  static boost::optional<OF_SHARED_PTR<modelgbp::gbp::Subnet> > resolve(
479  opflex::ofcore::OFFramework& framework,
480  const std::string& policySpaceName,
481  const std::string& gbpSubnetsName,
482  const std::string& gbpSubnetName)
483  {
484  return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpSubnets").addElement(gbpSubnetsName).addElement("GbpSubnet").addElement(gbpSubnetName).build());
485  }
486 
506  static boost::optional<OF_SHARED_PTR<modelgbp::gbp::Subnet> > resolve(
507  const std::string& policySpaceName,
508  const std::string& gbpSubnetsName,
509  const std::string& gbpSubnetName)
510  {
511  return resolve(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpSubnetsName,gbpSubnetName);
512  }
513 
522  void remove()
523  {
524  getTLMutator().remove(CLASS_ID, getURI());
525  }
526 
537  static void remove(opflex::ofcore::OFFramework& framework,
538  const opflex::modb::URI& uri)
539  {
540  MO::remove(framework, CLASS_ID, uri);
541  }
542 
553  static void remove(const opflex::modb::URI& uri)
554  {
555  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
556  }
557 
576  static void remove(
577  opflex::ofcore::OFFramework& framework,
578  const std::string& policySpaceName,
579  const std::string& gbpSubnetsName,
580  const std::string& gbpSubnetName)
581  {
582  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpSubnets").addElement(gbpSubnetsName).addElement("GbpSubnet").addElement(gbpSubnetName).build());
583  }
584 
603  static void remove(
604  const std::string& policySpaceName,
605  const std::string& gbpSubnetsName,
606  const std::string& gbpSubnetName)
607  {
608  remove(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpSubnetsName,gbpSubnetName);
609  }
610 
622  static void registerListener(
623  opflex::ofcore::OFFramework& framework,
624  opflex::modb::ObjectListener* listener)
625  {
626  opflex::modb::mointernal
627  ::MO::registerListener(framework, listener, CLASS_ID);
628  }
629 
641  static void registerListener(
642  opflex::modb::ObjectListener* listener)
643  {
644  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
645  }
646 
653  static void unregisterListener(
654  opflex::ofcore::OFFramework& framework,
655  opflex::modb::ObjectListener* listener)
656  {
657  opflex::modb::mointernal
658  ::MO::unregisterListener(framework, listener, CLASS_ID);
659  }
660 
667  static void unregisterListener(
668  opflex::modb::ObjectListener* listener)
669  {
670  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
671  }
672 
678  opflex::ofcore::OFFramework& framework,
679  const opflex::modb::URI& uri,
680  const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
681  : MO(framework, CLASS_ID, uri, oi) { }
682 }; // class Subnet
683 
684 } // namespace gbp
685 } // namespace modelgbp
686 #endif // GI_GBP_SUBNET_HPP
bool isIpv6AdvAutonomousFlagSet()
Check whether ipv6AdvAutonomousFlag has been set.
Definition: Subnet.hpp:91
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for Subnet.
Definition: Subnet.hpp:29
uint32_t getIpv6AdvPreferredLifetime(uint32_t defaultValue)
Get the value of ipv6AdvPreferredLifetime if set, otherwise the value of default passed in...
Definition: Subnet.hpp:168
modelgbp::gbp::Subnet & unsetAddress()
Unset address in the currently-active mutator.
Definition: Subnet.hpp:81
bool isAddressSet()
Check whether address has been set.
Definition: Subnet.hpp:35
boost::optional< uint32_t > getIpv6AdvValidLifetime()
Get the value of ipv6AdvValidLifetime if it has been set.
Definition: Subnet.hpp:212
uint32_t getIpv6AdvValidLifetime(uint32_t defaultValue)
Get the value of ipv6AdvValidLifetime if set, otherwise the value of default passed in...
Definition: Subnet.hpp:224
boost::optional< const std::string & > getVirtualRouterIp()
Get the value of virtualRouterIp if it has been set.
Definition: Subnet.hpp:380
bool isPrefixLenSet()
Check whether prefixLen has been set.
Definition: Subnet.hpp:315
modelgbp::gbp::Subnet & setAddress(const std::string &newValue)
Set address to the specified value in the currently-active mutator.
Definition: Subnet.hpp:69
modelgbp::gbp::Subnet & unsetIpv6AdvValidLifetime()
Unset ipv6AdvValidLifetime in the currently-active mutator.
Definition: Subnet.hpp:249
modelgbp::gbp::Subnet & unsetName()
Unset name in the currently-active mutator.
Definition: Subnet.hpp:305
modelgbp::gbp::Subnet & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: Subnet.hpp:293
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: Subnet.hpp:268
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: Subnet.hpp:667
const std::string & getVirtualRouterIp(const std::string &defaultValue)
Get the value of virtualRouterIp if set, otherwise the value of default passed in.
Definition: Subnet.hpp:392
boost::optional< const std::string & > getAddress()
Get the value of address if it has been set.
Definition: Subnet.hpp:44
modelgbp::gbp::Subnet & unsetIpv6AdvAutonomousFlag()
Unset ipv6AdvAutonomousFlag in the currently-active mutator.
Definition: Subnet.hpp:137
modelgbp::gbp::Subnet & unsetPrefixLen()
Unset prefixLen in the currently-active mutator.
Definition: Subnet.hpp:361
boost::optional< const uint8_t > getIpv6AdvAutonomousFlag()
Get the value of ipv6AdvAutonomousFlag if it has been set.
Definition: Subnet.hpp:100
modelgbp::gbp::Subnet & unsetIpv6AdvPreferredLifetime()
Unset ipv6AdvPreferredLifetime in the currently-active mutator.
Definition: Subnet.hpp:193
const uint8_t getPrefixLen(const uint8_t defaultValue)
Get the value of prefixLen if set, otherwise the value of default passed in.
Definition: Subnet.hpp:336
bool isVirtualRouterIpSet()
Check whether virtualRouterIp has been set.
Definition: Subnet.hpp:371
const uint8_t getIpv6AdvAutonomousFlag(const uint8_t defaultValue)
Get the value of ipv6AdvAutonomousFlag if set, otherwise the value of default passed in...
Definition: Subnet.hpp:112
modelgbp::gbp::Subnet & setVirtualRouterIp(const std::string &newValue)
Set virtualRouterIp to the specified value in the currently-active mutator.
Definition: Subnet.hpp:405
const std::string & getAddress(const std::string &defaultValue)
Get the value of address if set, otherwise the value of default passed in.
Definition: Subnet.hpp:56
bool isNameSet()
Check whether name has been set.
Definition: Subnet.hpp:259
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::Subnet > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Subnet from the managed object store.
Definition: Subnet.hpp:434
modelgbp::gbp::Subnet & setIpv6AdvAutonomousFlag(const uint8_t newValue)
Set ipv6AdvAutonomousFlag to the specified value in the currently-active mutator. ...
Definition: Subnet.hpp:125
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: Subnet.hpp:622
modelgbp::gbp::Subnet & setIpv6AdvValidLifetime(uint32_t newValue)
Set ipv6AdvValidLifetime to the specified value in the currently-active mutator.
Definition: Subnet.hpp:237
bool isIpv6AdvValidLifetimeSet()
Check whether ipv6AdvValidLifetime has been set.
Definition: Subnet.hpp:203
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::Subnet > > resolve(const std::string &policySpaceName, const std::string &gbpSubnetsName, const std::string &gbpSubnetName)
Retrieve an instance of Subnet from the default managed object store by constructing its URI from the...
Definition: Subnet.hpp:506
Subnet(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of Subnet.
Definition: Subnet.hpp:677
boost::optional< uint32_t > getIpv6AdvPreferredLifetime()
Get the value of ipv6AdvPreferredLifetime if it has been set.
Definition: Subnet.hpp:156
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::Subnet > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of Subnet from the managed object store using the default framework instance...
Definition: Subnet.hpp:452
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: Subnet.hpp:653
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: Subnet.hpp:641
modelgbp::gbp::Subnet & unsetVirtualRouterIp()
Unset virtualRouterIp in the currently-active mutator.
Definition: Subnet.hpp:417
boost::optional< const uint8_t > getPrefixLen()
Get the value of prefixLen if it has been set.
Definition: Subnet.hpp:324
Definition: Subnet.hpp:21
modelgbp::gbp::Subnet & setIpv6AdvPreferredLifetime(uint32_t newValue)
Set ipv6AdvPreferredLifetime to the specified value in the currently-active mutator.
Definition: Subnet.hpp:181
modelgbp::gbp::Subnet & setPrefixLen(const uint8_t newValue)
Set prefixLen to the specified value in the currently-active mutator.
Definition: Subnet.hpp:349
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::Subnet > > resolve(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpSubnetsName, const std::string &gbpSubnetName)
Retrieve an instance of Subnet from the managed object store by constructing its URI from the path el...
Definition: Subnet.hpp:478
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: Subnet.hpp:280
SOME COPYRIGHT.
Definition: OpcodeEnumT.hpp:12
bool isIpv6AdvPreferredLifetimeSet()
Check whether ipv6AdvPreferredLifetime has been set.
Definition: Subnet.hpp:147