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.

Jeongho Nam

Definition at line 29 of file Instance.hpp.

Constructor & Destructor Documentation

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

Default Constructor.

Definition at line 63 of file Instance.hpp.

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

Construct from instance.

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

Get name.

Definition at line 101 of file Instance.hpp.

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

Get price.

Definition at line 109 of file Instance.hpp.

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

Get volume.

Definition at line 117 of file Instance.hpp.

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

Get weight.

Definition at line 125 of file Instance.hpp.

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

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

Name represent the Instance.

Definition at line 39 of file Instance.hpp.

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

Price of an instance -> 1,000 won.

Definition at line 44 of file Instance.hpp.

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

Volume of an instance -> 130 cm^3.

Definition at line 49 of file Instance.hpp.

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

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: