Samchon Framework for CPP
1.0.0
|
A wrapper can contain products. More...
#include <Wrapper.hpp>
Public Member Functions | |
Wrapper () | |
Default Constructor. More... | |
Wrapper (const string &name, int price, int volume, int weight) | |
Construct from argument of a wrapper. More... | |
Wrapper (const Wrapper &wrapper) | |
Copy Constructor. More... | |
auto | tryInsert (shared_ptr< Product > product) -> bool |
Try to insert a product into the wrapper. More... | |
virtual auto | toString () const -> string override |
Return a string represent the wrapper. More... | |
Public Member Functions inherited from samchon::examples::packer::ProductArray | |
virtual auto | CHILD_TAG () const -> string override |
A tag name of children. More... | |
Public Member Functions inherited from samchon::protocol::EntityGroup< Container, T, Key > | |
virtual void | construct (std::shared_ptr< library::XML > xml) |
Construct data of the Entity from an XML object. More... | |
auto | find (const typename child_type::key_type &key) -> typename container_type::iterator |
Get iterator to element. More... | |
auto | find (const typename child_type::key_type &key) const -> typename container_type::const_iterator |
Get const iterator to element. More... | |
auto | has (const typename child_type::key_type &key) const -> bool |
Indicates whether a container has an object having the specified identifier. More... | |
auto | count (const typename child_type::key_type &key) const -> size_t |
Count elements with a specific key. More... | |
auto | get (const typename child_type::key_type &key) -> typename container_type::value_type & |
Access the element by specified identifier(key). More... | |
auto | get (const typename child_type::key_type &key) const -> const typename container_type::value_type & |
Access the const element by specified identifier(key). More... | |
Public Member Functions inherited from samchon::protocol::Entity< Key > | |
virtual auto | key () const -> Key |
Get a key that can identify the Entity uniquely. More... | |
Public Member Functions inherited from samchon::examples::packer::Instance | |
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... | |
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... | |
Additional Inherited Members | |
Protected Member Functions inherited from samchon::protocol::EntityGroup< Container, T, Key > | |
virtual auto | createChild (std::shared_ptr< library::XML >) -> child_type *=0 |
Factory method of a child Entity. More... | |
Protected Attributes inherited from samchon::examples::packer::Instance | |
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... | |
A wrapper can contain products.
A wrapper containing products with its limitation of weight and volume.
Definition at line 27 of file Wrapper.hpp.
|
inline |
Default Constructor.
Definition at line 41 of file Wrapper.hpp.
|
inline |
Construct from argument of a wrapper.
name | Category name of a wrapper, can be identified |
price | Price of a wrapper |
volume | Limited volume of a wrapper can put in. |
weight | Limited weight of a wrapper can put in. |
Definition at line 55 of file Wrapper.hpp.
|
inline |
Copy Constructor.
Copy constructor of wrapper does not copy children items. Only copies arguments of Instance's.
Definition at line 66 of file Wrapper.hpp.
|
inline |
Try to insert a product into the wrapper.
If the Wrapper has enough volume and limit of weight, inserts the Product into the Wrapper and returns true. If not enough, does not insert and just return false.
product | A product try to insert in. |
Definition at line 91 of file Wrapper.hpp.
Referenced by samchon::examples::packer::WrapperArray::optimize().
|
inlineoverridevirtual |
Return a string represent the wrapper.
Returns a string of the Wrapper and Product(s) packaged in.
Reimplemented from samchon::examples::packer::Instance.
Definition at line 134 of file Wrapper.hpp.
References samchon::examples::packer::Instance::toString().