modelgbp Generated OpFlex Model  1.3.0
Discoverer.hpp
1 
10 #pragma once
11 #ifndef GI_DCI_DISCOVERER_HPP
12 #define GI_DCI_DISCOVERER_HPP
13 
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
17 /*
18  * contains: item:mclass(dci/Ep)
19  */
20 #include "modelgbp/dci/Ep.hpp"
21 /*
22  * contains: item:mclass(dci/EpFromUnivRTgt)
23  */
24 #include "modelgbp/dci/EpFromUnivRTgt.hpp"
25 /*
26  * contains: item:mclass(dci/Domain)
27  */
28 #include "modelgbp/dci/Domain.hpp"
29 
30 namespace modelgbp {
31 namespace dci {
32 
34  : public opflex::modb::mointernal::MO
35 {
36 public:
37 
41  static const opflex::modb::class_id_t CLASS_ID = 65;
42 
47  bool isNameSet()
48  {
49  return getObjectInstance().isSet(2129921ul, opflex::modb::PropertyInfo::STRING);
50  }
51 
56  boost::optional<const std::string&> getName()
57  {
58  if (isNameSet())
59  return getObjectInstance().getString(2129921ul);
60  return boost::none;
61  }
62 
68  const std::string& getName(const std::string& defaultValue)
69  {
70  return getName().get_value_or(defaultValue);
71  }
72 
81  modelgbp::dci::Discoverer& setName(const std::string& newValue)
82  {
83  getTLMutator().modify(getClassId(), getURI())->setString(2129921ul, newValue);
84  return *this;
85  }
86 
94  {
95  getTLMutator().modify(getClassId(), getURI())->unset(2129921ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
96  return *this;
97  }
98 
110  static boost::optional<boost::shared_ptr<modelgbp::dci::Discoverer> > resolve(
111  opflex::ofcore::OFFramework& framework,
112  const opflex::modb::URI& uri)
113  {
114  return opflex::modb::mointernal::MO::resolve<modelgbp::dci::Discoverer>(framework, CLASS_ID, uri);
115  }
116 
128  static boost::optional<boost::shared_ptr<modelgbp::dci::Discoverer> > resolve(
129  const opflex::modb::URI& uri)
130  {
131  return opflex::modb::mointernal::MO::resolve<modelgbp::dci::Discoverer>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
132  }
133 
148  static boost::optional<boost::shared_ptr<modelgbp::dci::Discoverer> > resolve(
149  opflex::ofcore::OFFramework& framework)
150  {
151  return resolve(framework,opflex::modb::URIBuilder().addElement("DciDiscoverer").build());
152  }
153 
167  static boost::optional<boost::shared_ptr<modelgbp::dci::Discoverer> > resolve(
168  )
169  {
170  return resolve(opflex::ofcore::OFFramework::defaultInstance());
171  }
172 
182  boost::optional<boost::shared_ptr<modelgbp::dci::Ep> > resolveDciEp(
183  )
184  {
185  return modelgbp::dci::Ep::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("DciEp").build());
186  }
187 
198  boost::shared_ptr<modelgbp::dci::Ep> addDciEp(
199  )
200  {
201  boost::shared_ptr<modelgbp::dci::Ep> result = addChild<modelgbp::dci::Ep>(
202  CLASS_ID, getURI(), 2149613634ul, 66,
203  opflex::modb::URIBuilder(getURI()).addElement("DciEp").build()
204  );
205  return result;
206  }
207 
217  boost::optional<boost::shared_ptr<modelgbp::dci::EpFromUnivRTgt> > resolveDciEpFromUnivRTgt(
218  )
219  {
220  return modelgbp::dci::EpFromUnivRTgt::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("DciEpFromUnivRTgt").build());
221  }
222 
233  boost::shared_ptr<modelgbp::dci::EpFromUnivRTgt> addDciEpFromUnivRTgt(
234  )
235  {
236  boost::shared_ptr<modelgbp::dci::EpFromUnivRTgt> result = addChild<modelgbp::dci::EpFromUnivRTgt>(
237  CLASS_ID, getURI(), 2149613636ul, 68,
238  opflex::modb::URIBuilder(getURI()).addElement("DciEpFromUnivRTgt").build()
239  );
240  return result;
241  }
242 
254  boost::optional<boost::shared_ptr<modelgbp::dci::Domain> > resolveDciDomain(
255  const std::string& dciDomainName)
256  {
257  return modelgbp::dci::Domain::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("DciDomain").addElement(dciDomainName).build());
258  }
259 
272  boost::shared_ptr<modelgbp::dci::Domain> addDciDomain(
273  const std::string& dciDomainName)
274  {
275  boost::shared_ptr<modelgbp::dci::Domain> result = addChild<modelgbp::dci::Domain>(
276  CLASS_ID, getURI(), 2149613638ul, 70,
277  opflex::modb::URIBuilder(getURI()).addElement("DciDomain").addElement(dciDomainName).build()
278  );
279  result->setName(dciDomainName);
280  return result;
281  }
282 
297  void resolveDciDomain(/* out */ std::vector<boost::shared_ptr<modelgbp::dci::Domain> >& out)
298  {
299  opflex::modb::mointernal::MO::resolveChildren<modelgbp::dci::Domain>(
300  getFramework(), CLASS_ID, getURI(), 2149613638ul, 70, out);
301  }
302 
311  void remove()
312  {
313  getTLMutator().remove(CLASS_ID, getURI());
314  }
315 
326  static void remove(opflex::ofcore::OFFramework& framework,
327  const opflex::modb::URI& uri)
328  {
329  MO::remove(framework, CLASS_ID, uri);
330  }
331 
342  static void remove(const opflex::modb::URI& uri)
343  {
344  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
345  }
346 
358  static void registerListener(
359  opflex::ofcore::OFFramework& framework,
360  opflex::modb::ObjectListener* listener)
361  {
362  opflex::modb::mointernal
363  ::MO::registerListener(framework, listener, CLASS_ID);
364  }
365 
377  static void registerListener(
378  opflex::modb::ObjectListener* listener)
379  {
380  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
381  }
382 
389  static void unregisterListener(
390  opflex::ofcore::OFFramework& framework,
391  opflex::modb::ObjectListener* listener)
392  {
393  opflex::modb::mointernal
394  ::MO::unregisterListener(framework, listener, CLASS_ID);
395  }
396 
403  static void unregisterListener(
404  opflex::modb::ObjectListener* listener)
405  {
406  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
407  }
408 
414  opflex::ofcore::OFFramework& framework,
415  const opflex::modb::URI& uri,
416  const boost::shared_ptr<const opflex::modb::mointernal::ObjectInstance>& oi)
417  : MO(framework, CLASS_ID, uri, oi) { }
418 }; // class Discoverer
419 
420 } // namespace dci
421 } // namespace modelgbp
422 #endif // GI_DCI_DISCOVERER_HPP
static boost::optional< boost::shared_ptr< modelgbp::dci::Discoverer > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of Discoverer from the managed object store using the default framework instance...
Definition: Discoverer.hpp:128
static boost::optional< boost::shared_ptr< modelgbp::dci::Ep > > resolve()
Retrieve an instance of Ep from the default managed object store by constructing its URI from the pat...
Definition: Ep.hpp:103
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: Discoverer.hpp:68
boost::shared_ptr< modelgbp::dci::Domain > addDciDomain(const std::string &dciDomainName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Discoverer.hpp:272
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for Discoverer.
Definition: Discoverer.hpp:41
static boost::optional< boost::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
static boost::optional< boost::shared_ptr< modelgbp::dci::Discoverer > > resolve(opflex::ofcore::OFFramework &framework)
Retrieve an instance of Discoverer from the managed object store by constructing its URI from the pat...
Definition: Discoverer.hpp:148
static boost::optional< boost::shared_ptr< modelgbp::dci::Domain > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Domain from the managed object store.
Definition: Domain.hpp:102
modelgbp::dci::Discoverer & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: Discoverer.hpp:81
boost::optional< boost::shared_ptr< modelgbp::dci::Ep > > resolveDciEp()
Retrieve the child object with the specified naming properties.
Definition: Discoverer.hpp:182
static boost::optional< boost::shared_ptr< modelgbp::dci::Discoverer > > resolve()
Retrieve an instance of Discoverer from the default managed object store by constructing its URI from...
Definition: Discoverer.hpp:167
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: Discoverer.hpp:403
static boost::optional< boost::shared_ptr< modelgbp::dci::Discoverer > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Discoverer from the managed object store.
Definition: Discoverer.hpp:110
boost::shared_ptr< modelgbp::dci::EpFromUnivRTgt > addDciEpFromUnivRTgt()
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Discoverer.hpp:233
bool isNameSet()
Check whether name has been set.
Definition: Discoverer.hpp:47
boost::optional< boost::shared_ptr< modelgbp::dci::Domain > > resolveDciDomain(const std::string &dciDomainName)
Retrieve the child object with the specified naming properties.
Definition: Discoverer.hpp:254
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: Discoverer.hpp:56
modelgbp::dci::Discoverer & unsetName()
Unset name in the currently-active mutator.
Definition: Discoverer.hpp:93
void resolveDciDomain(std::vector< boost::shared_ptr< modelgbp::dci::Domain > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::dci::Domain. ...
Definition: Discoverer.hpp:297
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: Discoverer.hpp:389
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: Discoverer.hpp:377
Definition: Discoverer.hpp:33
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: Discoverer.hpp:358
boost::shared_ptr< modelgbp::dci::Ep > addDciEp()
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Discoverer.hpp:198
Discoverer(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const boost::shared_ptr< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of Discoverer.
Definition: Discoverer.hpp:413
boost::optional< boost::shared_ptr< modelgbp::dci::EpFromUnivRTgt > > resolveDciEpFromUnivRTgt()
Retrieve the child object with the specified naming properties.
Definition: Discoverer.hpp:217