QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Classes | Public Member Functions | Related Functions | List of all members
CommodityType Class Reference

commodity type More...

#include <ql/experimental/commodities/commoditytype.hpp>

+ Inheritance diagram for CommodityType:
+ Collaboration diagram for CommodityType:

Classes

struct  Data
 

Public Member Functions

 CommodityType ()=default
 default constructor More...
 
 CommodityType (const std::string &code, const std::string &name)
 
Inspectors
const std::string & code () const
 commodity code, e.g, "HO" More...
 
const std::string & name () const
 name, e.g, "Heating Oil" More...
 

Related Functions

(Note that these are not member functions.)

bool operator== (const CommodityType &, const CommodityType &)
 
bool operator!= (const CommodityType &, const CommodityType &)
 
std::ostream & operator<< (std::ostream &, const CommodityType &)
 

Other information

ext::shared_ptr< Datadata_
 
static std::map< std::string, ext::shared_ptr< Data > > commodityTypes_
 
bool empty () const
 is this a usable instance? More...
 

Detailed Description

commodity type

Definition at line 37 of file commoditytype.hpp.

Constructor & Destructor Documentation

◆ CommodityType() [1/2]

CommodityType ( )
default

default constructor

Instances built via this constructor have undefined behavior. Such instances can only act as placeholders and must be reassigned to a valid currency before being used.

◆ CommodityType() [2/2]

CommodityType ( const std::string &  code,
const std::string &  name 
)

Definition at line 28 of file commoditytype.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ code()

const std::string & code ( ) const

commodity code, e.g, "HO"

Definition at line 95 of file commoditytype.hpp.

+ Here is the caller graph for this function:

◆ name()

const std::string & name ( ) const

name, e.g, "Heating Oil"

Definition at line 99 of file commoditytype.hpp.

+ Here is the caller graph for this function:

◆ empty()

bool empty ( ) const

is this a usable instance?

Definition at line 103 of file commoditytype.hpp.

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator==()

bool operator== ( const CommodityType ,
const CommodityType  
)
related

Definition at line 107 of file commoditytype.hpp.

+ Here is the call graph for this function:

◆ operator!=()

bool operator!= ( const CommodityType ,
const CommodityType  
)
related

Definition at line 111 of file commoditytype.hpp.

◆ operator<<()

std::ostream & operator<< ( std::ostream &  ,
const CommodityType  
)
related

Definition at line 40 of file commoditytype.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ data_

ext::shared_ptr<Data> data_
protected

Definition at line 63 of file commoditytype.hpp.

◆ commodityTypes_

std::map< std::string, ext::shared_ptr< CommodityType::Data > > commodityTypes_
staticprotected

Definition at line 72 of file commoditytype.hpp.