g4tools  5.4.0
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
tools::osc::Item Class Reference
Inheritance diagram for tools::osc::Item:
Inheritance graph
[legend]
Collaboration diagram for tools::osc::Item:
Collaboration graph
[legend]

Public Member Functions

virtual const std::string & store_cls () const
 
virtual bool visit (iobj_const_visitor &a_visitor) const
 
virtual bool read (iobj_visitor &a_visitor)
 
 Item ()
 
 Item (const std::string &aKey, const std::string &aValue, bool aSticky)
 
virtual ~Item ()
 
 Item (const Item &a_from)
 
Itemoperator= (const Item &a_from)
 
- Public Member Functions inherited from tools::istorable
virtual ~istorable ()
 

Static Public Member Functions

static bool s_visit (const istorable &a_o, iobj_const_visitor &a_v)
 

Public Attributes

std::string fKey
 
std::string fValue
 
bool fSticky
 

Protected Member Functions

virtual void * cast (const std::string &a_class) const
 

Detailed Description

Definition at line 130 of file osc_streamers.

Constructor & Destructor Documentation

◆ Item() [1/3]

tools::osc::Item::Item ( )
inline

Definition at line 173 of file osc_streamers.

173 {}

◆ Item() [2/3]

tools::osc::Item::Item ( const std::string &  aKey,
const std::string &  aValue,
bool  aSticky 
)
inline

Definition at line 174 of file osc_streamers.

175  :fKey(aKey),fValue(aValue),fSticky(aSticky){}

◆ ~Item()

virtual tools::osc::Item::~Item ( )
inlinevirtual

Definition at line 176 of file osc_streamers.

176 {}

◆ Item() [3/3]

tools::osc::Item::Item ( const Item a_from)
inline

Definition at line 178 of file osc_streamers.

179  :istorable(a_from)
180  ,fKey(a_from.fKey)
181  ,fValue(a_from.fValue)
182  ,fSticky(a_from.fSticky)
183  {}

Member Function Documentation

◆ cast()

virtual void* tools::osc::Item::cast ( const std::string &  a_class) const
inlineprotectedvirtual

Implements tools::istorable.

Definition at line 134 of file osc_streamers.

134  {
135  if(void* p = cmp_cast<Item>(this,a_class)) return p;
136  return 0;
137  }

◆ operator=()

Item& tools::osc::Item::operator= ( const Item a_from)
inline

Definition at line 184 of file osc_streamers.

184  {
185  if(&a_from==this) return *this;
186  fKey = a_from.fKey;
187  fValue = a_from.fValue;
188  fSticky = a_from.fSticky;
189  return *this;
190  }

◆ read()

virtual bool tools::osc::Item::read ( iobj_visitor a_visitor)
inlinevirtual

Definition at line 159 of file osc_streamers.

159  {
160  //if(!a_visitor.begin(*this)) return false;
161 
162  int version;
163  if(!a_visitor.visit(version)) return false;
164 
165  if(!a_visitor.visit(fKey)) return false;
166  if(!a_visitor.visit(fValue)) return false;
167  if(!a_visitor.visit(fSticky)) return false;
168 
169  //if(!a_visitor.end(*this)) return false;
170  return true;
171  }

◆ s_visit()

static bool tools::osc::Item::s_visit ( const istorable a_o,
iobj_const_visitor a_v 
)
inlinestatic

Definition at line 153 of file osc_streamers.

153  {
154  const Item* local = safe_cast<istorable,Item>(a_o);
155  if(!local) return false;
156  return local->Item::visit(a_v); //IMPORTANT : have Item::
157  }

◆ store_cls()

virtual const std::string& tools::osc::Item::store_cls ( ) const
inlinevirtual

Implements tools::istorable.

Definition at line 139 of file osc_streamers.

139 {return s_item();}

◆ visit()

virtual bool tools::osc::Item::visit ( iobj_const_visitor a_visitor) const
inlinevirtual

Implements tools::istorable.

Definition at line 140 of file osc_streamers.

140  {
141  if(!a_visitor.begin(*this,s_item(),Item::s_visit)) return false;
142 
143  int version = 1;
144  if(!a_visitor.visit("fVersion",version)) return false;
145 
146  if(!a_visitor.visit("fKey",fKey)) return false;
147  if(!a_visitor.visit("fValue",fValue)) return false;
148  if(!a_visitor.visit("fSticky",fSticky)) return false;
149 
150  if(!a_visitor.end(*this)) return false;
151  return true;
152  }

Member Data Documentation

◆ fKey

std::string tools::osc::Item::fKey

Definition at line 192 of file osc_streamers.

◆ fSticky

bool tools::osc::Item::fSticky

Definition at line 194 of file osc_streamers.

◆ fValue

std::string tools::osc::Item::fValue

Definition at line 193 of file osc_streamers.


The documentation for this class was generated from the following file:
tools::osc::Item::Item
Item()
Definition: osc_streamers:173
tools::osc::Item::s_visit
static bool s_visit(const istorable &a_o, iobj_const_visitor &a_v)
Definition: osc_streamers:153
tools::version
unsigned int version()
Definition: version:14
tools::osc::Item::fKey
std::string fKey
Definition: osc_streamers:192
tools::osc::s_item
const std::string & s_item()
Definition: osc_streamers:36
tools::osc::Item::fValue
std::string fValue
Definition: osc_streamers:193
tools::osc::Item::fSticky
bool fSticky
Definition: osc_streamers:194