Electroneum
Loading...
Searching...
No Matches
Person Class Reference
Inheritance diagram for Person:

Public Member Functions

 Person (const std::string &name, unsigned age)
 Person (const Person &rhs)
virtual ~Person ()
Personoperator= (const Person &rhs)

Protected Member Functions

template<typename Writer>
void Serialize (Writer &writer) const

Detailed Description

Definition at line 11 of file serialize.cpp.

Constructor & Destructor Documentation

◆ Person() [1/2]

Person::Person ( const std::string & name,
unsigned age )
inline

Definition at line 13 of file serialize.cpp.

13: name_(name), age_(age) {}
Here is the caller graph for this function:

◆ Person() [2/2]

Person::Person ( const Person & rhs)
inline

Definition at line 14 of file serialize.cpp.

14: name_(rhs.name_), age_(rhs.age_) {}
Here is the call graph for this function:

◆ ~Person()

Person::~Person ( )
virtual

Definition at line 42 of file serialize.cpp.

42 {
43}

Member Function Documentation

◆ operator=()

Person & Person::operator= ( const Person & rhs)
inline

Definition at line 17 of file serialize.cpp.

17 {
18 name_ = rhs.name_;
19 age_ = rhs.age_;
20 return *this;
21 }
Here is the call graph for this function:

◆ Serialize()

template<typename Writer>
void Person::Serialize ( Writer & writer) const
inlineprotected

Definition at line 25 of file serialize.cpp.

25 {
26 // This base class just write out name-value pairs, without wrapping within an object.
27 writer.String("name");
28#if RAPIDJSON_HAS_STDSTRING
29 writer.String(name_);
30#else
31 writer.String(name_.c_str(), static_cast<SizeType>(name_.length())); // Supplying length of string is faster.
32#endif
33 writer.String("age");
34 writer.Uint(age_);
35 }
bool Uint(unsigned u)
Definition writer.h:184
bool String(const Ch *str, SizeType length, bool copy=false)
Definition writer.h:202
RAPIDJSON_NAMESPACE_BEGIN typedef unsigned SizeType
Size type (for string lengths, array sizes, etc.).
Definition rapidjson.h:389
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/external/rapidjson/example/serialize/serialize.cpp