'ODTONE - Open Dot Twenty One'

PrevUpHomeNext

Class template enumeration

odtone::mih::enumeration

Synopsis

// In header: </home/carlos/Projectos/odtone/inc/odtone/mih/types/base.hpp>

template<typename T> 
class enumeration {
public:
  // construct/copy/destruct
  enumeration();
  enumeration(T);
  enumeration& operator=(T);

  // private member functions
   ODTONE_STATIC_ASSERT(boost::is_enum< T >::value, 
                        "T must be an enumeration");

  // public member functions
  T get() const;
  template<typename ArchiveT> void serialize(ArchiveT &);
  bool operator==(T) const;
  bool operator!=(T) const;
  bool operator==(const enumeration &) const;
  bool operator!=(const enumeration &) const;

  // friend functions
  friend std::ostream & operator<<(std::ostream &, const enumeration &);
};

Description

ENUMERATED data type.

enumeration public construct/copy/destruct

  1. enumeration();

    Construct an empty ENUMERATION data type.

  2. enumeration(T val);

    Construct an ENUMERATION data type.

    Parameters:

    val

    The value of the ENUMERATION data type.

  3. enumeration& operator=(T val);

    Set the ENUMERATION data type.

    Parameters:

    val

    The value to assign to the ENUMERATION data type.

enumeration private member functions

  1.  ODTONE_STATIC_ASSERT(boost::is_enum< T >::value, "T must be an enumeration");

enumeration public member functions

  1. T get() const;

    Get the ENUMERATION data type value.

    Returns:

    The value of the ENUMERATION data type.

  2. template<typename ArchiveT> void serialize(ArchiveT & ar);

    Serialize/deserialize the ENUMERATION data type.

    Parameters:

    ar

    The archive to/from where serialize/deserialize the data type.

  3. bool operator==(T val) const;

    Check if the ENUMERATION value is equal to the argument value.

    Parameters:

    val

    The value to compare with.

    Returns:

    True if they are equal or false otherwise.

  4. bool operator!=(T val) const;

    Check if the ENUMERATION value is equal to the argument value.

    Parameters:

    val

    The value to compare with.

    Returns:

    True if they are equal or false otherwise.

  5. bool operator==(const enumeration & e) const;

    Check if the ENUMERATION is equal to another ENUMERATION.

    Parameters:

    e

    The ENUMERATION to compare with.

    Returns:

    True if they are equal or false otherwise.

  6. bool operator!=(const enumeration & e) const;

    Check if the ENUMERATION is equal to another ENUMERATION.

    Parameters:

    e

    The ENUMERATION to compare with.

    Returns:

    True if they are equal or false otherwise.

enumeration friend functions

  1. friend std::ostream & operator<<(std::ostream & os, const enumeration & e);

    ENUMERATION data type output.

    Parameters:

    e

    ENUMERATION data type.

    os

    ostream.

    Returns:

    ostream reference.


PrevUpHomeNext