modelgbp Generated OpFlex Model  1.7.0
EpFromUnivRTgt.hpp
1 
10 #pragma once
11 #ifndef GI_DCI_EPFROMUNIVRTGT_HPP
12 #define GI_DCI_EPFROMUNIVRTGT_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 = 85;
30 
35  bool isRoleSet()
36  {
37  return getObjectInstance().isSet(2785282ul, opflex::modb::PropertyInfo::ENUM8);
38  }
39 
44  boost::optional<const uint8_t> getRole()
45  {
46  if (isRoleSet())
47  return (const uint8_t)getObjectInstance().getUInt64(2785282ul);
48  return boost::none;
49  }
50 
56  const uint8_t getRole(const uint8_t defaultValue)
57  {
58  return getRole().get_value_or(defaultValue);
59  }
60 
69  modelgbp::dci::EpFromUnivRTgt& setRole(const uint8_t newValue)
70  {
71  getTLMutator().modify(getClassId(), getURI())->setUInt64(2785282ul, newValue);
72  return *this;
73  }
74 
82  {
83  getTLMutator().modify(getClassId(), getURI())->unset(2785282ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
84  return *this;
85  }
86 
91  bool isSourceSet()
92  {
93  return getObjectInstance().isSet(2785283ul, opflex::modb::PropertyInfo::STRING);
94  }
95 
100  boost::optional<const std::string&> getSource()
101  {
102  if (isSourceSet())
103  return getObjectInstance().getString(2785283ul);
104  return boost::none;
105  }
106 
112  const std::string& getSource(const std::string& defaultValue)
113  {
114  return getSource().get_value_or(defaultValue);
115  }
116 
125  modelgbp::dci::EpFromUnivRTgt& setSource(const std::string& newValue)
126  {
127  getTLMutator().modify(getClassId(), getURI())->setString(2785283ul, newValue);
128  return *this;
129  }
130 
138  {
139  getTLMutator().modify(getClassId(), getURI())->unset(2785283ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
140  return *this;
141  }
142 
147  bool isTypeSet()
148  {
149  return getObjectInstance().isSet(2785281ul, opflex::modb::PropertyInfo::ENUM8);
150  }
151 
156  boost::optional<const uint8_t> getType()
157  {
158  if (isTypeSet())
159  return (const uint8_t)getObjectInstance().getUInt64(2785281ul);
160  return boost::none;
161  }
162 
168  const uint8_t getType(const uint8_t defaultValue)
169  {
170  return getType().get_value_or(defaultValue);
171  }
172 
181  modelgbp::dci::EpFromUnivRTgt& setType(const uint8_t newValue)
182  {
183  getTLMutator().modify(getClassId(), getURI())->setUInt64(2785281ul, newValue);
184  return *this;
185  }
186 
194  {
195  getTLMutator().modify(getClassId(), getURI())->unset(2785281ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
196  return *this;
197  }
198 
210  static boost::optional<OF_SHARED_PTR<modelgbp::dci::EpFromUnivRTgt> > resolve(
211  opflex::ofcore::OFFramework& framework,
212  const opflex::modb::URI& uri)
213  {
214  return opflex::modb::mointernal::MO::resolve<modelgbp::dci::EpFromUnivRTgt>(framework, CLASS_ID, uri);
215  }
216 
228  static boost::optional<OF_SHARED_PTR<modelgbp::dci::EpFromUnivRTgt> > resolve(
229  const opflex::modb::URI& uri)
230  {
231  return opflex::modb::mointernal::MO::resolve<modelgbp::dci::EpFromUnivRTgt>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
232  }
233 
248  static boost::optional<OF_SHARED_PTR<modelgbp::dci::EpFromUnivRTgt> > resolve(
249  opflex::ofcore::OFFramework& framework)
250  {
251  return resolve(framework,opflex::modb::URIBuilder().addElement("DciUniverse").addElement("DciEpFromUnivRTgt").build());
252  }
253 
267  static boost::optional<OF_SHARED_PTR<modelgbp::dci::EpFromUnivRTgt> > resolve(
268  )
269  {
270  return resolve(opflex::ofcore::OFFramework::defaultInstance());
271  }
272 
281  void remove()
282  {
283  getTLMutator().remove(CLASS_ID, getURI());
284  }
285 
296  static void remove(opflex::ofcore::OFFramework& framework,
297  const opflex::modb::URI& uri)
298  {
299  MO::remove(framework, CLASS_ID, uri);
300  }
301 
312  static void remove(const opflex::modb::URI& uri)
313  {
314  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
315  }
316 
328  static void registerListener(
329  opflex::ofcore::OFFramework& framework,
330  opflex::modb::ObjectListener* listener)
331  {
332  opflex::modb::mointernal
333  ::MO::registerListener(framework, listener, CLASS_ID);
334  }
335 
347  static void registerListener(
348  opflex::modb::ObjectListener* listener)
349  {
350  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
351  }
352 
359  static void unregisterListener(
360  opflex::ofcore::OFFramework& framework,
361  opflex::modb::ObjectListener* listener)
362  {
363  opflex::modb::mointernal
364  ::MO::unregisterListener(framework, listener, CLASS_ID);
365  }
366 
373  static void unregisterListener(
374  opflex::modb::ObjectListener* listener)
375  {
376  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
377  }
378 
384  opflex::ofcore::OFFramework& framework,
385  const opflex::modb::URI& uri,
386  const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
387  : MO(framework, CLASS_ID, uri, oi) { }
388 }; // class EpFromUnivRTgt
389 
390 } // namespace dci
391 } // namespace modelgbp
392 #endif // GI_DCI_EPFROMUNIVRTGT_HPP
bool isTypeSet()
Check whether type has been set.
Definition: EpFromUnivRTgt.hpp:147
static boost::optional< OF_SHARED_PTR< modelgbp::dci::EpFromUnivRTgt > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of EpFromUnivRTgt from the managed object store using the default framework inst...
Definition: EpFromUnivRTgt.hpp:228
EpFromUnivRTgt(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of EpFromUnivRTgt.
Definition: EpFromUnivRTgt.hpp:383
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: EpFromUnivRTgt.hpp:373
const uint8_t getRole(const uint8_t defaultValue)
Get the value of role if set, otherwise the value of default passed in.
Definition: EpFromUnivRTgt.hpp:56
modelgbp::dci::EpFromUnivRTgt & setRole(const uint8_t newValue)
Set role to the specified value in the currently-active mutator.
Definition: EpFromUnivRTgt.hpp:69
modelgbp::dci::EpFromUnivRTgt & setType(const uint8_t newValue)
Set type to the specified value in the currently-active mutator.
Definition: EpFromUnivRTgt.hpp:181
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: EpFromUnivRTgt.hpp:328
const uint8_t getType(const uint8_t defaultValue)
Get the value of type if set, otherwise the value of default passed in.
Definition: EpFromUnivRTgt.hpp:168
modelgbp::dci::EpFromUnivRTgt & unsetType()
Unset type in the currently-active mutator.
Definition: EpFromUnivRTgt.hpp:193
boost::optional< const std::string & > getSource()
Get the value of source if it has been set.
Definition: EpFromUnivRTgt.hpp:100
static boost::optional< OF_SHARED_PTR< modelgbp::dci::EpFromUnivRTgt > > resolve(opflex::ofcore::OFFramework &framework)
Retrieve an instance of EpFromUnivRTgt from the managed object store by constructing its URI from the...
Definition: EpFromUnivRTgt.hpp:248
const std::string & getSource(const std::string &defaultValue)
Get the value of source if set, otherwise the value of default passed in.
Definition: EpFromUnivRTgt.hpp:112
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for EpFromUnivRTgt.
Definition: EpFromUnivRTgt.hpp:29
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: EpFromUnivRTgt.hpp:347
static boost::optional< OF_SHARED_PTR< modelgbp::dci::EpFromUnivRTgt > > resolve()
Retrieve an instance of EpFromUnivRTgt from the default managed object store by constructing its URI ...
Definition: EpFromUnivRTgt.hpp:267
boost::optional< const uint8_t > getRole()
Get the value of role if it has been set.
Definition: EpFromUnivRTgt.hpp:44
boost::optional< const uint8_t > getType()
Get the value of type if it has been set.
Definition: EpFromUnivRTgt.hpp:156
bool isRoleSet()
Check whether role has been set.
Definition: EpFromUnivRTgt.hpp:35
modelgbp::dci::EpFromUnivRTgt & unsetSource()
Unset source in the currently-active mutator.
Definition: EpFromUnivRTgt.hpp:137
static boost::optional< OF_SHARED_PTR< modelgbp::dci::EpFromUnivRTgt > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of EpFromUnivRTgt from the managed object store.
Definition: EpFromUnivRTgt.hpp:210
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: EpFromUnivRTgt.hpp:359
bool isSourceSet()
Check whether source has been set.
Definition: EpFromUnivRTgt.hpp:91
Definition: EpFromUnivRTgt.hpp:21
modelgbp::dci::EpFromUnivRTgt & unsetRole()
Unset role in the currently-active mutator.
Definition: EpFromUnivRTgt.hpp:81
modelgbp::dci::EpFromUnivRTgt & setSource(const std::string &newValue)
Set source to the specified value in the currently-active mutator.
Definition: EpFromUnivRTgt.hpp:125