Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Employee Class Reference
Inheritance diagram for Employee:
Collaboration diagram for Employee:

Public Member Functions

 Employee (const std::string &name, unsigned age, bool married)
 
 Employee (const Employee &rhs)
 
virtual ~Employee ()
 
Employeeoperator= (const Employee &rhs)
 
void AddDependent (const Dependent &dependent)
 
template<typename Writer >
void Serialize (Writer &writer) const
 
- Public Member Functions inherited from Person
 Person (const std::string &name, unsigned age)
 
 Person (const Person &rhs)
 
virtual ~Person ()
 
Personoperator= (const Person &rhs)
 

Additional Inherited Members

- Protected Member Functions inherited from Person
template<typename Writer >
void Serialize (Writer &writer) const
 

Detailed Description

Definition at line 110 of file serialize.cpp.

Constructor & Destructor Documentation

◆ Employee() [1/2]

Employee::Employee ( const std::string & name,
unsigned age,
bool married )
inline

Definition at line 112 of file serialize.cpp.

112: Person(name, age), dependents_(), married_(married) {}
std::string name
Person(const std::string &name, unsigned age)
Definition serialize.cpp:13

◆ Employee() [2/2]

Employee::Employee ( const Employee & rhs)
inline

Definition at line 113 of file serialize.cpp.

113: Person(rhs), dependents_(rhs.dependents_), married_(rhs.married_) {}

◆ ~Employee()

Employee::~Employee ( )
virtual

Definition at line 150 of file serialize.cpp.

150 {
151}

Member Function Documentation

◆ AddDependent()

void Employee::AddDependent ( const Dependent & dependent)
inline

Definition at line 123 of file serialize.cpp.

123 {
124 dependents_.push_back(dependent);
125 }

◆ operator=()

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

Definition at line 116 of file serialize.cpp.

116 {
117 static_cast<Person&>(*this) = rhs;
118 dependents_ = rhs.dependents_;
119 married_ = rhs.married_;
120 return *this;
121 }

◆ Serialize()

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

Definition at line 128 of file serialize.cpp.

128 {
129 writer.StartObject();
130
131 Person::Serialize(writer);
132
133 writer.String("married");
134 writer.Bool(married_);
135
136 writer.String(("dependents"));
137 writer.StartArray();
138 for (std::vector<Dependent>::const_iterator dependentItr = dependents_.begin(); dependentItr != dependents_.end(); ++dependentItr)
139 dependentItr->Serialize(writer);
140 writer.EndArray();
141
142 writer.EndObject();
143 }
void Serialize(Writer &writer) const
Definition serialize.cpp:25
bool EndObject(SizeType memberCount=0)
Definition writer.h:230
bool StartArray()
Definition writer.h:239
bool String(const Ch *str, SizeType length, bool copy=false)
Definition writer.h:202
bool EndArray(SizeType elementCount=0)
Definition writer.h:245
bool Bool(bool b)
Definition writer.h:182
bool StartObject()
Definition writer.h:215
Here is the call graph for this function:

The documentation for this class was generated from the following file: