MADARA  3.1.8
VariableReference.inl
Go to the documentation of this file.
1 #ifndef _MADARA_VARIABLE_REFERENCE_INL_
2 #define _MADARA_VARIABLE_REFERENCE_INL_
3 
4 
12 inline const char *
14 {
15  return name_.get_ptr ();
16 }
17 
18 inline void
20 const std::string & name)
21 {
22  // create a new char array and copy over the string
23  uint32_t size = uint32_t (name.length () + 1);
24  char * temp = new char[size];
25  strncpy (temp, name.c_str (), size - 1);
26  temp[size - 1] = 0;
27  name_ = temp;
28 }
29 
30 inline bool
32 {
33  return record_ != 0;
34 }
35 
36 
37 
38 #endif // _MADARA_VARIABLE_REFERENCE_INL_
utility::ScopedArray< const char > name_
potential string value of the node (size int)
bool is_valid(void) const
Checks to see if the variable reference has been initialized.
T * get_ptr(void)
get the underlying pointer
Definition: ScopedArray.inl:68
static constexpr struct madara::knowledge::tags::string_t string
const char * get_name(void) const
Returns the name of the variable.
void set_name(const std::string &name)
Sets the name of the variable.
knowledge::KnowledgeRecord * record_
Reference to knowledge record.