Public Member Functions | Friends | List of all members
minxlib::type_info Class Reference

Wrapper around std::type_info. More...

#include <type_info.hh>

Public Member Functions

 type_info ()
 Default constructor for std::type_info wrapper. More...
 
 type_info (const std::type_info &t)
 Construct type_info wrapper given std::type_info. More...
 

Friends

bool operator== (const type_info &, const type_info &)
 Check if two type_info objects are equal. More...
 
bool operator< (const type_info &, const type_info &)
 Check if one type_info object less than another. More...
 

Detailed Description

Wrapper around std::type_info.

Because std::type_info::name() is unreliable, we can use this wrapper class when we want to identify different classes in a unique way so as to be able to use class typeid's in conjunction with object factories and other such constructions.

The only thing you can do with minxlib::type_info objects are create them and compare them using the relational operators (i.e., ==, !=, <, >, <=, and >=).

Constructor & Destructor Documentation

minxlib::type_info::type_info ( )

Default constructor for std::type_info wrapper.

Returns
std::type_info wrapper object.

A default constructor so we can store type_info wrapper objects in STL containers.

minxlib::type_info::type_info ( const std::type_info &  t)

Construct type_info wrapper given std::type_info.

Parameters
tResult of typeid operator on some object or type.
Returns
std::type_info wrapper object.

Friends And Related Function Documentation

bool operator< ( const type_info a,
const type_info b 
)
friend

Check if one type_info object less than another.

Parameters
aLHS of < operator.
bRHS of < operator.
Returns
True if a < b, false if a >= b.
bool operator== ( const type_info a,
const type_info b 
)
friend

Check if two type_info objects are equal.

Parameters
aLHS of equality operator.
bRHS of equality operator.
Returns
True if a == b, false otherwise.