Samchon Framework for CPP  1.0.0
samchon::examples::packer::Instance Class Reference

A physical instance. More...

#include <Instance.hpp>

Collaboration diagram for samchon::examples::packer::Instance:

Public Member Functions

 Instance ()
 Default Constructor. More...
 
 Instance (const string &name, int price, int volume, int weight)
 Construct from instance. More...
 
auto get_name () const -> string
 Get name. More...
 
auto getPrice () const -> int
 Get price. More...
 
auto getVolume () const -> int
 Get volume. More...
 
auto getWeight () const -> int
 Get weight. More...
 
virtual auto toString () const -> string
 Return a string represents the Instance. More...
 
- Public Member Functions inherited from samchon::protocol::Entity< std::string >
virtual auto key () const -> std::string
 Get a key that can identify the Entity uniquely. More...
 

Protected Attributes

string name
 Name represent the Instance. More...
 
int price
 Price of an instance -> 1,000 won. More...
 
int volume
 Volume of an instance -> 130 cm^3. More...
 
int weight
 Weight of an instance -> 1,200 g. More...
 

Detailed Description

A physical instance.

A physical instance having its own name, price, volume and weight.

example_packer.png
Author
Jeongho Nam http://samchon.org

Definition at line 29 of file Instance.hpp.

Constructor & Destructor Documentation

samchon::examples::packer::Instance::Instance ( )
inline

Default Constructor.

Definition at line 63 of file Instance.hpp.

samchon::examples::packer::Instance::Instance ( const string &  name,
int  price,
int  volume,
int  weight 
)
inline

Construct from instance.

Parameters
nameName of the instance
pricePrice of the instance
volumeVolume of the instance
weightWeight of the instance

Definition at line 76 of file Instance.hpp.

Member Function Documentation

auto samchon::examples::packer::Instance::get_name ( ) const -> string
inline

Get name.

Definition at line 101 of file Instance.hpp.

auto samchon::examples::packer::Instance::getPrice ( ) const -> int
inline

Get price.

Definition at line 109 of file Instance.hpp.

auto samchon::examples::packer::Instance::getVolume ( ) const -> int
inline

Get volume.

Definition at line 117 of file Instance.hpp.

auto samchon::examples::packer::Instance::getWeight ( ) const -> int
inline

Get weight.

Definition at line 125 of file Instance.hpp.

virtual auto samchon::examples::packer::Instance::toString ( ) const -> string
inlinevirtual

Return a string represents the Instance.

Reimplemented in samchon::examples::packer::Wrapper, and samchon::examples::packer::Product.

Definition at line 147 of file Instance.hpp.

References samchon::library::StringUtil::substitute().

Referenced by samchon::examples::packer::Wrapper::toString().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

string samchon::examples::packer::Instance::name
protected

Name represent the Instance.

Definition at line 39 of file Instance.hpp.

int samchon::examples::packer::Instance::price
protected

Price of an instance -> 1,000 won.

Definition at line 44 of file Instance.hpp.

int samchon::examples::packer::Instance::volume
protected

Volume of an instance -> 130 cm^3.

Definition at line 49 of file Instance.hpp.

int samchon::examples::packer::Instance::weight
protected

Weight of an instance -> 1,200 g.

Definition at line 54 of file Instance.hpp.


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