modelgbp Generated OpFlex Model  1.9.0
RemoteIp.hpp
1 
10 #pragma once
11 #ifndef GI_INV_REMOTEIP_HPP
12 #define GI_INV_REMOTEIP_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 inv {
20 
21 class RemoteIp
22  : public opflex::modb::mointernal::MO
23 {
24 public:
25 
29  static const opflex::modb::class_id_t CLASS_ID = 127;
30 
35  bool isIpSet()
36  {
37  return getObjectInstance().isSet(4161537ul, opflex::modb::PropertyInfo::STRING);
38  }
39 
44  boost::optional<const std::string&> getIp()
45  {
46  if (isIpSet())
47  return getObjectInstance().getString(4161537ul);
48  return boost::none;
49  }
50 
56  const std::string& getIp(const std::string& defaultValue)
57  {
58  return getIp().get_value_or(defaultValue);
59  }
60 
69  modelgbp::inv::RemoteIp& setIp(const std::string& newValue)
70  {
71  getTLMutator().modify(getClassId(), getURI())->setString(4161537ul, newValue);
72  return *this;
73  }
74 
82  {
83  getTLMutator().modify(getClassId(), getURI())->unset(4161537ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
84  return *this;
85  }
86 
98  static boost::optional<OF_SHARED_PTR<modelgbp::inv::RemoteIp> > resolve(
99  opflex::ofcore::OFFramework& framework,
100  const opflex::modb::URI& uri)
101  {
102  return opflex::modb::mointernal::MO::resolve<modelgbp::inv::RemoteIp>(framework, CLASS_ID, uri);
103  }
104 
116  static boost::optional<OF_SHARED_PTR<modelgbp::inv::RemoteIp> > resolve(
117  const opflex::modb::URI& uri)
118  {
119  return opflex::modb::mointernal::MO::resolve<modelgbp::inv::RemoteIp>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
120  }
121 
140  static boost::optional<OF_SHARED_PTR<modelgbp::inv::RemoteIp> > resolve(
141  opflex::ofcore::OFFramework& framework,
142  const std::string& invRemoteInventoryEpUuid,
143  const std::string& invRemoteIpIp)
144  {
145  return resolve(framework,opflex::modb::URIBuilder().addElement("InvUniverse").addElement("InvRemoteEndpointInventory").addElement("InvRemoteInventoryEp").addElement(invRemoteInventoryEpUuid).addElement("InvRemoteIp").addElement(invRemoteIpIp).build());
146  }
147 
165  static boost::optional<OF_SHARED_PTR<modelgbp::inv::RemoteIp> > resolve(
166  const std::string& invRemoteInventoryEpUuid,
167  const std::string& invRemoteIpIp)
168  {
169  return resolve(opflex::ofcore::OFFramework::defaultInstance(),invRemoteInventoryEpUuid,invRemoteIpIp);
170  }
171 
180  void remove()
181  {
182  getTLMutator().remove(CLASS_ID, getURI());
183  }
184 
195  static void remove(opflex::ofcore::OFFramework& framework,
196  const opflex::modb::URI& uri)
197  {
198  MO::remove(framework, CLASS_ID, uri);
199  }
200 
211  static void remove(const opflex::modb::URI& uri)
212  {
213  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
214  }
215 
232  static void remove(
233  opflex::ofcore::OFFramework& framework,
234  const std::string& invRemoteInventoryEpUuid,
235  const std::string& invRemoteIpIp)
236  {
237  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("InvUniverse").addElement("InvRemoteEndpointInventory").addElement("InvRemoteInventoryEp").addElement(invRemoteInventoryEpUuid).addElement("InvRemoteIp").addElement(invRemoteIpIp).build());
238  }
239 
256  static void remove(
257  const std::string& invRemoteInventoryEpUuid,
258  const std::string& invRemoteIpIp)
259  {
260  remove(opflex::ofcore::OFFramework::defaultInstance(),invRemoteInventoryEpUuid,invRemoteIpIp);
261  }
262 
274  static void registerListener(
275  opflex::ofcore::OFFramework& framework,
276  opflex::modb::ObjectListener* listener)
277  {
278  opflex::modb::mointernal
279  ::MO::registerListener(framework, listener, CLASS_ID);
280  }
281 
293  static void registerListener(
294  opflex::modb::ObjectListener* listener)
295  {
296  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
297  }
298 
305  static void unregisterListener(
306  opflex::ofcore::OFFramework& framework,
307  opflex::modb::ObjectListener* listener)
308  {
309  opflex::modb::mointernal
310  ::MO::unregisterListener(framework, listener, CLASS_ID);
311  }
312 
319  static void unregisterListener(
320  opflex::modb::ObjectListener* listener)
321  {
322  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
323  }
324 
330  opflex::ofcore::OFFramework& framework,
331  const opflex::modb::URI& uri,
332  const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
333  : MO(framework, CLASS_ID, uri, oi) { }
334 }; // class RemoteIp
335 
336 } // namespace inv
337 } // namespace modelgbp
338 #endif // GI_INV_REMOTEIP_HPP
static boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteIp > > resolve(opflex::ofcore::OFFramework &framework, const std::string &invRemoteInventoryEpUuid, const std::string &invRemoteIpIp)
Retrieve an instance of RemoteIp from the managed object store by constructing its URI from the path ...
Definition: RemoteIp.hpp:140
modelgbp::inv::RemoteIp & setIp(const std::string &newValue)
Set ip to the specified value in the currently-active mutator.
Definition: RemoteIp.hpp:69
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: RemoteIp.hpp:319
static boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteIp > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of RemoteIp from the managed object store.
Definition: RemoteIp.hpp:98
const std::string & getIp(const std::string &defaultValue)
Get the value of ip if set, otherwise the value of default passed in.
Definition: RemoteIp.hpp:56
static boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteIp > > resolve(const std::string &invRemoteInventoryEpUuid, const std::string &invRemoteIpIp)
Retrieve an instance of RemoteIp from the default managed object store by constructing its URI from t...
Definition: RemoteIp.hpp:165
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for RemoteIp.
Definition: RemoteIp.hpp:29
modelgbp::inv::RemoteIp & unsetIp()
Unset ip in the currently-active mutator.
Definition: RemoteIp.hpp:81
bool isIpSet()
Check whether ip has been set.
Definition: RemoteIp.hpp:35
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: RemoteIp.hpp:293
static boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteIp > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of RemoteIp from the managed object store using the default framework instance...
Definition: RemoteIp.hpp:116
boost::optional< const std::string & > getIp()
Get the value of ip if it has been set.
Definition: RemoteIp.hpp:44
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: RemoteIp.hpp:274
RemoteIp(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of RemoteIp.
Definition: RemoteIp.hpp:329
Definition: RemoteIp.hpp:21
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: RemoteIp.hpp:305