OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
t_base_type Class Reference

#include <t_base_type.h>

Inheritance diagram for t_base_type:
Collaboration diagram for t_base_type:

Public Types

enum  t_base {
  TYPE_VOID, TYPE_STRING, TYPE_BOOL, TYPE_BYTE,
  TYPE_I16, TYPE_I32, TYPE_I64, TYPE_DOUBLE
}
 

Public Member Functions

 t_base_type (std::string name, t_base base)
 
t_base get_base () const
 
bool is_void () const
 
bool is_string () const
 
bool is_bool () const
 
void set_string_list (bool val)
 
bool is_string_list () const
 
void set_binary (bool val)
 
bool is_binary () const
 
void set_string_enum (bool val)
 
bool is_string_enum () const
 
void add_string_enum_val (std::string val)
 
const std::vector< std::string > & get_string_enum_vals () const
 
bool is_base_type () const
 
virtual std::string get_fingerprint_material () const
 
- Public Member Functions inherited from t_type
virtual ~t_type ()
 
virtual void set_name (const std::string &name)
 
virtual const std::string & get_name () const
 
virtual bool is_typedef () const
 
virtual bool is_enum () const
 
virtual bool is_struct () const
 
virtual bool is_xception () const
 
virtual bool is_container () const
 
virtual bool is_list () const
 
virtual bool is_set () const
 
virtual bool is_map () const
 
virtual bool is_service () const
 
t_programget_program ()
 
t_typeget_true_type ()
 
virtual void generate_fingerprint ()
 
bool has_fingerprint () const
 
const uint8_t * get_binary_fingerprint () const
 
std::string get_ascii_fingerprint () const
 
const uint32_t get_4byte_fingerprint () const
 
- Public Member Functions inherited from t_doc
 t_doc ()
 
void set_doc (const std::string &doc)
 
const std::string & get_doc () const
 
bool has_doc ()
 

Static Public Member Functions

static std::string t_base_name (t_base tbase)
 
- Static Public Member Functions inherited from t_type
static char nybble_to_xdigit (int num)
 
static std::string byte_to_hex (uint8_t byte)
 

Private Attributes

t_base base_
 
bool string_list_
 
bool binary_
 
bool string_enum_
 
std::vector< std::string > string_enum_vals_
 

Additional Inherited Members

- Public Attributes inherited from t_type
std::map< std::string,
std::string > 
annotations_
 
- Static Public Attributes inherited from t_type
static const int fingerprint_len = 16
 
- Protected Member Functions inherited from t_type
 t_type ()
 
 t_type (t_program *program)
 
 t_type (t_program *program, std::string name)
 
 t_type (std::string name)
 
- Protected Attributes inherited from t_type
t_programprogram_
 
std::string name_
 
uint8_t fingerprint_ [fingerprint_len]
 

Detailed Description

A thrift base type, which must be one of the defined enumerated types inside this definition.

Definition at line 34 of file t_base_type.h.

Member Enumeration Documentation

Enumeration of thrift base types

Enumerator
TYPE_VOID 
TYPE_STRING 
TYPE_BOOL 
TYPE_BYTE 
TYPE_I16 
TYPE_I32 
TYPE_I64 
TYPE_DOUBLE 

Definition at line 39 of file t_base_type.h.

Constructor & Destructor Documentation

t_base_type::t_base_type ( std::string  name,
t_base  base 
)
inline

Definition at line 74 of file t_base_type.h.

Member Function Documentation

void t_base_type::add_string_enum_val ( std::string  val)
inline

Definition at line 198 of file t_base_type.h.

t_base t_base_type::get_base ( ) const
inline

Definition at line 81 of file t_base_type.h.

virtual std::string t_base_type::get_fingerprint_material ( ) const
inlinevirtual

Implements t_type.

Definition at line 210 of file t_base_type.h.

Here is the call graph for this function:

const std::vector<std::string>& t_base_type::get_string_enum_vals ( ) const
inline

Definition at line 202 of file t_base_type.h.

bool t_base_type::is_base_type ( ) const
inlinevirtual

Reimplemented from t_type.

Definition at line 206 of file t_base_type.h.

bool t_base_type::is_binary ( ) const
inline

Definition at line 186 of file t_base_type.h.

bool t_base_type::is_bool ( ) const
inlinevirtual

Reimplemented from t_type.

Definition at line 93 of file t_base_type.h.

bool t_base_type::is_string ( ) const
inlinevirtual

Reimplemented from t_type.

Definition at line 89 of file t_base_type.h.

bool t_base_type::is_string_enum ( ) const
inline

Definition at line 194 of file t_base_type.h.

bool t_base_type::is_string_list ( ) const
inline

Definition at line 178 of file t_base_type.h.

bool t_base_type::is_void ( ) const
inlinevirtual

Reimplemented from t_type.

Definition at line 85 of file t_base_type.h.

void t_base_type::set_binary ( bool  val)
inline

Definition at line 182 of file t_base_type.h.

void t_base_type::set_string_enum ( bool  val)
inline

Definition at line 190 of file t_base_type.h.

void t_base_type::set_string_list ( bool  val)
inline

Definition at line 174 of file t_base_type.h.

static std::string t_base_type::t_base_name ( t_base  tbase)
inlinestatic

Definition at line 218 of file t_base_type.h.

Member Data Documentation

t_base t_base_type::base_
private

Definition at line 256 of file t_base_type.h.

bool t_base_type::binary_
private

Definition at line 259 of file t_base_type.h.

bool t_base_type::string_enum_
private

Definition at line 260 of file t_base_type.h.

std::vector<std::string> t_base_type::string_enum_vals_
private

Definition at line 261 of file t_base_type.h.

bool t_base_type::string_list_
private

Definition at line 258 of file t_base_type.h.


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