JayBeams  0.1
Another project to have fun coding.
Public Member Functions | Private Attributes | Friends | List of all members
jb::itch5::char_list_field< V > Class Template Reference

A helper type to define char fields with a limited set of values. More...

#include <char_list_field.hpp>

Inheritance diagram for jb::itch5::char_list_field< V >:

Public Member Functions

 char_list_field ()
 Default constructor. More...
 
 char_list_field (int x)
 Constructor from an integer value. More...
 
int as_int () const
 Return the integer value. More...
 
Comparison operators
bool operator== (char_list_field const &rhs) const
 
bool operator== (int rhs) const
 
bool operator< (char_list_field const &rhs) const
 
bool operator< (int rhs) const
 

Private Attributes

int value_
 In-memory representation of the field (int). More...
 

Friends

struct decoder< true, char_list_field >
 
struct decoder< false, char_list_field >
 

Detailed Description

template<int... V>
class jb::itch5::char_list_field< V >

A helper type to define char fields with a limited set of values.

Many ITCH-5.0 fields are represented by a single byte on the wire, and are only supposed to take a limited set of values.

Definition at line 22 of file char_list_field.hpp.

Constructor & Destructor Documentation

◆ char_list_field() [1/2]

template<int... V>
jb::itch5::char_list_field< V >::char_list_field ( )
inline

Default constructor.

Definition at line 29 of file char_list_field.hpp.

◆ char_list_field() [2/2]

template<int... V>
jb::itch5::char_list_field< V >::char_list_field ( int  x)
inlineexplicit

Constructor from an integer value.

Exceptions
std::runtime_exceptionif the value is not in the template parameter list

Definition at line 39 of file char_list_field.hpp.

Member Function Documentation

◆ as_int()

template<int... V>
int jb::itch5::char_list_field< V >::as_int ( ) const
inline

Return the integer value.

Definition at line 46 of file char_list_field.hpp.

Referenced by main(), and jb::itch5::operator<<().

◆ operator<() [1/2]

template<int... V>
bool jb::itch5::char_list_field< V >::operator< ( char_list_field< V > const &  rhs) const
inline

Definition at line 60 of file char_list_field.hpp.

◆ operator<() [2/2]

template<int... V>
bool jb::itch5::char_list_field< V >::operator< ( int  rhs) const
inline

Definition at line 63 of file char_list_field.hpp.

◆ operator==() [1/2]

template<int... V>
bool jb::itch5::char_list_field< V >::operator== ( char_list_field< V > const &  rhs) const
inline

Definition at line 54 of file char_list_field.hpp.

◆ operator==() [2/2]

template<int... V>
bool jb::itch5::char_list_field< V >::operator== ( int  rhs) const
inline

Definition at line 57 of file char_list_field.hpp.

Friends And Related Function Documentation

◆ decoder< false, char_list_field >

template<int... V>
friend struct decoder< false, char_list_field >
friend

Definition at line 70 of file char_list_field.hpp.

◆ decoder< true, char_list_field >

template<int... V>
friend struct decoder< true, char_list_field >
friend

Definition at line 69 of file char_list_field.hpp.

Member Data Documentation

◆ value_

template<int... V>
int jb::itch5::char_list_field< V >::value_
private

The documentation for this class was generated from the following file: