modelgbp Generated OpFlex Model  1.7.0
lacp/Config.hpp
1 
10 #pragma once
11 #ifndef GI_LACP_CONFIG_HPP
12 #define GI_LACP_CONFIG_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 lacp {
20 
21 class Config
22  : public opflex::modb::mointernal::MO
23 {
24 public:
25 
29  static const opflex::modb::class_id_t CLASS_ID = 64;
30 
36  {
37  return getObjectInstance().isSet(2097157ul, opflex::modb::PropertyInfo::U64);
38  }
39 
44  boost::optional<const uint8_t> getControlBits()
45  {
46  if (isControlBitsSet())
47  return (const uint8_t)getObjectInstance().getUInt64(2097157ul);
48  return boost::none;
49  }
50 
56  const uint8_t getControlBits(const uint8_t defaultValue)
57  {
58  return getControlBits().get_value_or(defaultValue);
59  }
60 
69  modelgbp::lacp::Config& setControlBits(const uint8_t newValue)
70  {
71  getTLMutator().modify(getClassId(), getURI())->setUInt64(2097157ul, newValue);
72  return *this;
73  }
74 
82  {
83  getTLMutator().modify(getClassId(), getURI())->unset(2097157ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
84  return *this;
85  }
86 
92  {
93  return getObjectInstance().isSet(2097155ul, opflex::modb::PropertyInfo::U64);
94  }
95 
100  boost::optional<uint16_t> getMaxLinks()
101  {
102  if (isMaxLinksSet())
103  return (uint16_t)getObjectInstance().getUInt64(2097155ul);
104  return boost::none;
105  }
106 
112  uint16_t getMaxLinks(uint16_t defaultValue)
113  {
114  return getMaxLinks().get_value_or(defaultValue);
115  }
116 
126  {
127  getTLMutator().modify(getClassId(), getURI())->setUInt64(2097155ul, newValue);
128  return *this;
129  }
130 
138  {
139  getTLMutator().modify(getClassId(), getURI())->unset(2097155ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
140  return *this;
141  }
142 
148  {
149  return getObjectInstance().isSet(2097154ul, opflex::modb::PropertyInfo::U64);
150  }
151 
156  boost::optional<uint16_t> getMinLinks()
157  {
158  if (isMinLinksSet())
159  return (uint16_t)getObjectInstance().getUInt64(2097154ul);
160  return boost::none;
161  }
162 
168  uint16_t getMinLinks(uint16_t defaultValue)
169  {
170  return getMinLinks().get_value_or(defaultValue);
171  }
172 
182  {
183  getTLMutator().modify(getClassId(), getURI())->setUInt64(2097154ul, newValue);
184  return *this;
185  }
186 
194  {
195  getTLMutator().modify(getClassId(), getURI())->unset(2097154ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
196  return *this;
197  }
198 
203  bool isModeSet()
204  {
205  return getObjectInstance().isSet(2097156ul, opflex::modb::PropertyInfo::ENUM8);
206  }
207 
212  boost::optional<const uint8_t> getMode()
213  {
214  if (isModeSet())
215  return (const uint8_t)getObjectInstance().getUInt64(2097156ul);
216  return boost::none;
217  }
218 
224  const uint8_t getMode(const uint8_t defaultValue)
225  {
226  return getMode().get_value_or(defaultValue);
227  }
228 
237  modelgbp::lacp::Config& setMode(const uint8_t newValue)
238  {
239  getTLMutator().modify(getClassId(), getURI())->setUInt64(2097156ul, newValue);
240  return *this;
241  }
242 
250  {
251  getTLMutator().modify(getClassId(), getURI())->unset(2097156ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
252  return *this;
253  }
254 
259  bool isNameSet()
260  {
261  return getObjectInstance().isSet(2097153ul, opflex::modb::PropertyInfo::STRING);
262  }
263 
268  boost::optional<const std::string&> getName()
269  {
270  if (isNameSet())
271  return getObjectInstance().getString(2097153ul);
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::lacp::Config& setName(const std::string& newValue)
294  {
295  getTLMutator().modify(getClassId(), getURI())->setString(2097153ul, newValue);
296  return *this;
297  }
298 
306  {
307  getTLMutator().modify(getClassId(), getURI())->unset(2097153ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
308  return *this;
309  }
310 
322  static boost::optional<OF_SHARED_PTR<modelgbp::lacp::Config> > resolve(
323  opflex::ofcore::OFFramework& framework,
324  const opflex::modb::URI& uri)
325  {
326  return opflex::modb::mointernal::MO::resolve<modelgbp::lacp::Config>(framework, CLASS_ID, uri);
327  }
328 
340  static boost::optional<OF_SHARED_PTR<modelgbp::lacp::Config> > resolve(
341  const opflex::modb::URI& uri)
342  {
343  return opflex::modb::mointernal::MO::resolve<modelgbp::lacp::Config>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
344  }
345 
362  static boost::optional<OF_SHARED_PTR<modelgbp::lacp::Config> > resolve(
363  opflex::ofcore::OFFramework& framework,
364  const std::string& platformConfigName)
365  {
366  return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PlatformConfig").addElement(platformConfigName).addElement("LacpConfig").build());
367  }
368 
384  static boost::optional<OF_SHARED_PTR<modelgbp::lacp::Config> > resolve(
385  const std::string& platformConfigName)
386  {
387  return resolve(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName);
388  }
389 
398  void remove()
399  {
400  getTLMutator().remove(CLASS_ID, getURI());
401  }
402 
413  static void remove(opflex::ofcore::OFFramework& framework,
414  const opflex::modb::URI& uri)
415  {
416  MO::remove(framework, CLASS_ID, uri);
417  }
418 
429  static void remove(const opflex::modb::URI& uri)
430  {
431  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
432  }
433 
448  static void remove(
449  opflex::ofcore::OFFramework& framework,
450  const std::string& platformConfigName)
451  {
452  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PlatformConfig").addElement(platformConfigName).addElement("LacpConfig").build());
453  }
454 
469  static void remove(
470  const std::string& platformConfigName)
471  {
472  remove(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName);
473  }
474 
486  static void registerListener(
487  opflex::ofcore::OFFramework& framework,
488  opflex::modb::ObjectListener* listener)
489  {
490  opflex::modb::mointernal
491  ::MO::registerListener(framework, listener, CLASS_ID);
492  }
493 
505  static void registerListener(
506  opflex::modb::ObjectListener* listener)
507  {
508  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
509  }
510 
517  static void unregisterListener(
518  opflex::ofcore::OFFramework& framework,
519  opflex::modb::ObjectListener* listener)
520  {
521  opflex::modb::mointernal
522  ::MO::unregisterListener(framework, listener, CLASS_ID);
523  }
524 
531  static void unregisterListener(
532  opflex::modb::ObjectListener* listener)
533  {
534  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
535  }
536 
542  opflex::ofcore::OFFramework& framework,
543  const opflex::modb::URI& uri,
544  const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
545  : MO(framework, CLASS_ID, uri, oi) { }
546 }; // class Config
547 
548 } // namespace lacp
549 } // namespace modelgbp
550 #endif // GI_LACP_CONFIG_HPP
boost::optional< const uint8_t > getMode()
Get the value of mode if it has been set.
Definition: lacp/Config.hpp:212
Definition: lacp/Config.hpp:21
static boost::optional< OF_SHARED_PTR< modelgbp::lacp::Config > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of Config from the managed object store using the default framework instance...
Definition: lacp/Config.hpp:340
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: lacp/Config.hpp:517
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for Config.
Definition: lacp/Config.hpp:29
bool isControlBitsSet()
Check whether controlBits has been set.
Definition: lacp/Config.hpp:35
bool isMaxLinksSet()
Check whether maxLinks has been set.
Definition: lacp/Config.hpp:91
static boost::optional< OF_SHARED_PTR< modelgbp::lacp::Config > > resolve(opflex::ofcore::OFFramework &framework, const std::string &platformConfigName)
Retrieve an instance of Config from the managed object store by constructing its URI from the path el...
Definition: lacp/Config.hpp:362
Config(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of Config.
Definition: lacp/Config.hpp:541
modelgbp::lacp::Config & unsetName()
Unset name in the currently-active mutator.
Definition: lacp/Config.hpp:305
uint16_t getMinLinks(uint16_t defaultValue)
Get the value of minLinks if set, otherwise the value of default passed in.
Definition: lacp/Config.hpp:168
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: lacp/Config.hpp:280
uint16_t getMaxLinks(uint16_t defaultValue)
Get the value of maxLinks if set, otherwise the value of default passed in.
Definition: lacp/Config.hpp:112
bool isNameSet()
Check whether name has been set.
Definition: lacp/Config.hpp:259
modelgbp::lacp::Config & setMinLinks(uint16_t newValue)
Set minLinks to the specified value in the currently-active mutator.
Definition: lacp/Config.hpp:181
bool isMinLinksSet()
Check whether minLinks has been set.
Definition: lacp/Config.hpp:147
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: lacp/Config.hpp:486
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: lacp/Config.hpp:505
static boost::optional< OF_SHARED_PTR< modelgbp::lacp::Config > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Config from the managed object store.
Definition: lacp/Config.hpp:322
boost::optional< uint16_t > getMaxLinks()
Get the value of maxLinks if it has been set.
Definition: lacp/Config.hpp:100
modelgbp::lacp::Config & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: lacp/Config.hpp:293
modelgbp::lacp::Config & unsetControlBits()
Unset controlBits in the currently-active mutator.
Definition: lacp/Config.hpp:81
modelgbp::lacp::Config & unsetMinLinks()
Unset minLinks in the currently-active mutator.
Definition: lacp/Config.hpp:193
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: lacp/Config.hpp:268
bool isModeSet()
Check whether mode has been set.
Definition: lacp/Config.hpp:203
modelgbp::lacp::Config & setControlBits(const uint8_t newValue)
Set controlBits to the specified value in the currently-active mutator.
Definition: lacp/Config.hpp:69
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: lacp/Config.hpp:531
modelgbp::lacp::Config & setMaxLinks(uint16_t newValue)
Set maxLinks to the specified value in the currently-active mutator.
Definition: lacp/Config.hpp:125
const uint8_t getMode(const uint8_t defaultValue)
Get the value of mode if set, otherwise the value of default passed in.
Definition: lacp/Config.hpp:224
modelgbp::lacp::Config & unsetMode()
Unset mode in the currently-active mutator.
Definition: lacp/Config.hpp:249
boost::optional< const uint8_t > getControlBits()
Get the value of controlBits if it has been set.
Definition: lacp/Config.hpp:44
modelgbp::lacp::Config & unsetMaxLinks()
Unset maxLinks in the currently-active mutator.
Definition: lacp/Config.hpp:137
const uint8_t getControlBits(const uint8_t defaultValue)
Get the value of controlBits if set, otherwise the value of default passed in.
Definition: lacp/Config.hpp:56
static boost::optional< OF_SHARED_PTR< modelgbp::lacp::Config > > resolve(const std::string &platformConfigName)
Retrieve an instance of Config from the default managed object store by constructing its URI from the...
Definition: lacp/Config.hpp:384
modelgbp::lacp::Config & setMode(const uint8_t newValue)
Set mode to the specified value in the currently-active mutator.
Definition: lacp/Config.hpp:237
SOME COPYRIGHT.
Definition: OpcodeEnumT.hpp:12
boost::optional< uint16_t > getMinLinks()
Get the value of minLinks if it has been set.
Definition: lacp/Config.hpp:156