modelgbp Generated OpFlex Model  1.7.0
dfw/EpCounter.hpp
1 
10 #pragma once
11 #ifndef GI_DFW_EPCOUNTER_HPP
12 #define GI_DFW_EPCOUNTER_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 dfw {
20 
21 class EpCounter
22  : public opflex::modb::mointernal::MO
23 {
24 public:
25 
29  static const opflex::modb::class_id_t CLASS_ID = 55;
30 
35  bool isRxDropSet()
36  {
37  return getObjectInstance().isSet(1802242ul, opflex::modb::PropertyInfo::U64);
38  }
39 
44  boost::optional<uint64_t> getRxDrop()
45  {
46  if (isRxDropSet())
47  return getObjectInstance().getUInt64(1802242ul);
48  return boost::none;
49  }
50 
56  uint64_t getRxDrop(uint64_t defaultValue)
57  {
58  return getRxDrop().get_value_or(defaultValue);
59  }
60 
69  modelgbp::dfw::EpCounter& setRxDrop(uint64_t newValue)
70  {
71  getTLMutator().modify(getClassId(), getURI())->setUInt64(1802242ul, newValue);
72  return *this;
73  }
74 
82  {
83  getTLMutator().modify(getClassId(), getURI())->unset(1802242ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
84  return *this;
85  }
86 
91  bool isTxDropSet()
92  {
93  return getObjectInstance().isSet(1802243ul, opflex::modb::PropertyInfo::U64);
94  }
95 
100  boost::optional<uint64_t> getTxDrop()
101  {
102  if (isTxDropSet())
103  return getObjectInstance().getUInt64(1802243ul);
104  return boost::none;
105  }
106 
112  uint64_t getTxDrop(uint64_t defaultValue)
113  {
114  return getTxDrop().get_value_or(defaultValue);
115  }
116 
126  {
127  getTLMutator().modify(getClassId(), getURI())->setUInt64(1802243ul, newValue);
128  return *this;
129  }
130 
138  {
139  getTLMutator().modify(getClassId(), getURI())->unset(1802243ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
140  return *this;
141  }
142 
147  bool isUuidSet()
148  {
149  return getObjectInstance().isSet(1802241ul, opflex::modb::PropertyInfo::STRING);
150  }
151 
156  boost::optional<const std::string&> getUuid()
157  {
158  if (isUuidSet())
159  return getObjectInstance().getString(1802241ul);
160  return boost::none;
161  }
162 
168  const std::string& getUuid(const std::string& defaultValue)
169  {
170  return getUuid().get_value_or(defaultValue);
171  }
172 
181  modelgbp::dfw::EpCounter& setUuid(const std::string& newValue)
182  {
183  getTLMutator().modify(getClassId(), getURI())->setString(1802241ul, newValue);
184  return *this;
185  }
186 
194  {
195  getTLMutator().modify(getClassId(), getURI())->unset(1802241ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
196  return *this;
197  }
198 
210  static boost::optional<OF_SHARED_PTR<modelgbp::dfw::EpCounter> > resolve(
211  opflex::ofcore::OFFramework& framework,
212  const opflex::modb::URI& uri)
213  {
214  return opflex::modb::mointernal::MO::resolve<modelgbp::dfw::EpCounter>(framework, CLASS_ID, uri);
215  }
216 
228  static boost::optional<OF_SHARED_PTR<modelgbp::dfw::EpCounter> > resolve(
229  const opflex::modb::URI& uri)
230  {
231  return opflex::modb::mointernal::MO::resolve<modelgbp::dfw::EpCounter>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
232  }
233 
250  static boost::optional<OF_SHARED_PTR<modelgbp::dfw::EpCounter> > resolve(
251  opflex::ofcore::OFFramework& framework,
252  const std::string& dfwEpCounterUuid)
253  {
254  return resolve(framework,opflex::modb::URIBuilder().addElement("ObserverEpStatUniverse").addElement("DfwEpCounter").addElement(dfwEpCounterUuid).build());
255  }
256 
272  static boost::optional<OF_SHARED_PTR<modelgbp::dfw::EpCounter> > resolve(
273  const std::string& dfwEpCounterUuid)
274  {
275  return resolve(opflex::ofcore::OFFramework::defaultInstance(),dfwEpCounterUuid);
276  }
277 
286  void remove()
287  {
288  getTLMutator().remove(CLASS_ID, getURI());
289  }
290 
301  static void remove(opflex::ofcore::OFFramework& framework,
302  const opflex::modb::URI& uri)
303  {
304  MO::remove(framework, CLASS_ID, uri);
305  }
306 
317  static void remove(const opflex::modb::URI& uri)
318  {
319  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
320  }
321 
336  static void remove(
337  opflex::ofcore::OFFramework& framework,
338  const std::string& dfwEpCounterUuid)
339  {
340  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("ObserverEpStatUniverse").addElement("DfwEpCounter").addElement(dfwEpCounterUuid).build());
341  }
342 
357  static void remove(
358  const std::string& dfwEpCounterUuid)
359  {
360  remove(opflex::ofcore::OFFramework::defaultInstance(),dfwEpCounterUuid);
361  }
362 
374  static void registerListener(
375  opflex::ofcore::OFFramework& framework,
376  opflex::modb::ObjectListener* listener)
377  {
378  opflex::modb::mointernal
379  ::MO::registerListener(framework, listener, CLASS_ID);
380  }
381 
393  static void registerListener(
394  opflex::modb::ObjectListener* listener)
395  {
396  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
397  }
398 
405  static void unregisterListener(
406  opflex::ofcore::OFFramework& framework,
407  opflex::modb::ObjectListener* listener)
408  {
409  opflex::modb::mointernal
410  ::MO::unregisterListener(framework, listener, CLASS_ID);
411  }
412 
419  static void unregisterListener(
420  opflex::modb::ObjectListener* listener)
421  {
422  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
423  }
424 
430  opflex::ofcore::OFFramework& framework,
431  const opflex::modb::URI& uri,
432  const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
433  : MO(framework, CLASS_ID, uri, oi) { }
434 }; // class EpCounter
435 
436 } // namespace dfw
437 } // namespace modelgbp
438 #endif // GI_DFW_EPCOUNTER_HPP
Definition: dfw/EpCounter.hpp:21
modelgbp::dfw::EpCounter & setRxDrop(uint64_t newValue)
Set rxDrop to the specified value in the currently-active mutator.
Definition: dfw/EpCounter.hpp:69
bool isUuidSet()
Check whether uuid has been set.
Definition: dfw/EpCounter.hpp:147
const std::string & getUuid(const std::string &defaultValue)
Get the value of uuid if set, otherwise the value of default passed in.
Definition: dfw/EpCounter.hpp:168
bool isTxDropSet()
Check whether txDrop has been set.
Definition: dfw/EpCounter.hpp:91
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for EpCounter.
Definition: dfw/EpCounter.hpp:29
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: dfw/EpCounter.hpp:405
boost::optional< uint64_t > getTxDrop()
Get the value of txDrop if it has been set.
Definition: dfw/EpCounter.hpp:100
static boost::optional< OF_SHARED_PTR< modelgbp::dfw::EpCounter > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of EpCounter from the managed object store using the default framework instance...
Definition: dfw/EpCounter.hpp:228
static boost::optional< OF_SHARED_PTR< modelgbp::dfw::EpCounter > > resolve(const std::string &dfwEpCounterUuid)
Retrieve an instance of EpCounter from the default managed object store by constructing its URI from ...
Definition: dfw/EpCounter.hpp:272
modelgbp::dfw::EpCounter & setTxDrop(uint64_t newValue)
Set txDrop to the specified value in the currently-active mutator.
Definition: dfw/EpCounter.hpp:125
modelgbp::dfw::EpCounter & unsetUuid()
Unset uuid in the currently-active mutator.
Definition: dfw/EpCounter.hpp:193
boost::optional< const std::string & > getUuid()
Get the value of uuid if it has been set.
Definition: dfw/EpCounter.hpp:156
static boost::optional< OF_SHARED_PTR< modelgbp::dfw::EpCounter > > resolve(opflex::ofcore::OFFramework &framework, const std::string &dfwEpCounterUuid)
Retrieve an instance of EpCounter from the managed object store by constructing its URI from the path...
Definition: dfw/EpCounter.hpp:250
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: dfw/EpCounter.hpp:374
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: dfw/EpCounter.hpp:393
boost::optional< uint64_t > getRxDrop()
Get the value of rxDrop if it has been set.
Definition: dfw/EpCounter.hpp:44
bool isRxDropSet()
Check whether rxDrop has been set.
Definition: dfw/EpCounter.hpp:35
modelgbp::dfw::EpCounter & unsetRxDrop()
Unset rxDrop in the currently-active mutator.
Definition: dfw/EpCounter.hpp:81
EpCounter(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of EpCounter.
Definition: dfw/EpCounter.hpp:429
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: dfw/EpCounter.hpp:419
uint64_t getTxDrop(uint64_t defaultValue)
Get the value of txDrop if set, otherwise the value of default passed in.
Definition: dfw/EpCounter.hpp:112
modelgbp::dfw::EpCounter & unsetTxDrop()
Unset txDrop in the currently-active mutator.
Definition: dfw/EpCounter.hpp:137
uint64_t getRxDrop(uint64_t defaultValue)
Get the value of rxDrop if set, otherwise the value of default passed in.
Definition: dfw/EpCounter.hpp:56
static boost::optional< OF_SHARED_PTR< modelgbp::dfw::EpCounter > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of EpCounter from the managed object store.
Definition: dfw/EpCounter.hpp:210
modelgbp::dfw::EpCounter & setUuid(const std::string &newValue)
Set uuid to the specified value in the currently-active mutator.
Definition: dfw/EpCounter.hpp:181