Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
AbstractFactory::PtreeEmployeeFactory Class Reference

An employee factory implementation that uses Boost property trees to construct employee instances. More...

#include <ptree-employee-factory.h>

Inheritance diagram for AbstractFactory::PtreeEmployeeFactory:
Inheritance graph
Collaboration diagram for AbstractFactory::PtreeEmployeeFactory:
Collaboration graph

Public Member Functions

 PtreeEmployeeFactory (const boost::property_tree::ptree &ptree)
 Creates a factory that analyzes the given property tree, and construct an employee instance. More...
 
Employee Create () final
 Instructs this factory to create a value. More...
 
- Public Member Functions inherited from AbstractFactory::Factory< Employee >
virtual ~Factory ()
 Destructor needs to be virtual. More...
 
virtual Employee Create (TArgs...args)=0
 Instructs this factory to create a value. More...
 

Static Public Attributes

static constexpr const char * EmployeeNameKey = "Name"
 The Boost property tree key for the employees' names. More...
 
static constexpr const char * EmployeeDepartmentNameKey = "DepartmentName"
 The Boost property tree key for the employees' department names. More...
 
static constexpr const char * EmployeeSalaryKey = "Salary"
 The Boost property tree key for the employees' salaries. More...
 

Private Attributes

boost::property_tree::ptree m_ptree
 

Detailed Description

An employee factory implementation that uses Boost property trees to construct employee instances.

Definition at line 30 of file ptree-employee-factory.h.

Constructor & Destructor Documentation

AbstractFactory::PtreeEmployeeFactory::PtreeEmployeeFactory ( const boost::property_tree::ptree &  ptree)
inlineexplicit

Creates a factory that analyzes the given property tree, and construct an employee instance.

Definition at line 34 of file ptree-employee-factory.h.

Member Function Documentation

Employee AbstractFactory::PtreeEmployeeFactory::Create ( )
final

Member Data Documentation

constexpr const char* AbstractFactory::PtreeEmployeeFactory::EmployeeNameKey = "Name"
static

The Boost property tree key for the employees' names.

Definition at line 40 of file ptree-employee-factory.h.

Referenced by Create(), and toPtree().

constexpr const char* AbstractFactory::PtreeEmployeeFactory::EmployeeDepartmentNameKey = "DepartmentName"
static

The Boost property tree key for the employees' department names.

Definition at line 43 of file ptree-employee-factory.h.

Referenced by Create(), and toPtree().

constexpr const char* AbstractFactory::PtreeEmployeeFactory::EmployeeSalaryKey = "Salary"
static

The Boost property tree key for the employees' salaries.

Definition at line 46 of file ptree-employee-factory.h.

Referenced by Create(), and toPtree().

boost::property_tree::ptree AbstractFactory::PtreeEmployeeFactory::m_ptree
private

Definition at line 49 of file ptree-employee-factory.h.

Referenced by Create().


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