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

#include <t_type.h>

Inheritance diagram for t_type:
Collaboration diagram for t_type:

Public Member Functions

virtual ~t_type ()
 
virtual void set_name (const std::string &name)
 
virtual const std::string & get_name () const
 
virtual bool is_void () const
 
virtual bool is_base_type () const
 
virtual bool is_string () const
 
virtual bool is_bool () 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 std::string get_fingerprint_material () const =0
 
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 char nybble_to_xdigit (int num)
 
static std::string byte_to_hex (uint8_t byte)
 

Public Attributes

std::map< std::string,
std::string > 
annotations_
 

Static Public Attributes

static const int fingerprint_len = 16
 

Protected Member Functions

 t_type ()
 
 t_type (t_program *program)
 
 t_type (t_program *program, std::string name)
 
 t_type (std::string name)
 

Protected Attributes

t_programprogram_
 
std::string name_
 
uint8_t fingerprint_ [fingerprint_len]
 

Detailed Description

Generic representation of a thrift type. These objects are used by the parser module to build up a tree of object that are all explicitly typed. The generic t_type class exports a variety of useful methods that are used by the code generator to branch based upon different handling for the various types.

Definition at line 48 of file t_type.h.

Constructor & Destructor Documentation

virtual t_type::~t_type ( )
inlinevirtual

Definition at line 50 of file t_type.h.

t_type::t_type ( )
inlineprotected

Definition at line 174 of file t_type.h.

t_type::t_type ( t_program program)
inlineprotected

Definition at line 180 of file t_type.h.

t_type::t_type ( t_program program,
std::string  name 
)
inlineprotected

Definition at line 186 of file t_type.h.

t_type::t_type ( std::string  name)
inlineprotected

Definition at line 193 of file t_type.h.

Member Function Documentation

static std::string t_type::byte_to_hex ( uint8_t  byte)
inlinestatic

Definition at line 132 of file t_type.h.

Here is the call graph for this function:

void t_type::generate_fingerprint ( )
virtual

Reimplemented in t_struct_common, t_typedef, t_map, t_list, and t_set.

Definition at line 13 of file parse.cc.

Here is the call graph for this function:

const uint32_t t_type::get_4byte_fingerprint ( ) const
inline

Definition at line 139 of file t_type.h.

Here is the call graph for this function:

std::string t_type::get_ascii_fingerprint ( ) const
inline

Definition at line 114 of file t_type.h.

Here is the call graph for this function:

const uint8_t* t_type::get_binary_fingerprint ( ) const
inline

Definition at line 110 of file t_type.h.

virtual std::string t_type::get_fingerprint_material ( ) const
pure virtual
virtual const std::string& t_type::get_name ( ) const
inlinevirtual

Definition at line 56 of file t_type.h.

t_program* t_type::get_program ( )
inline

Definition at line 81 of file t_type.h.

t_type * t_type::get_true_type ( )

Definition at line 21 of file parse.cc.

Here is the call graph for this function:

bool t_type::has_fingerprint ( ) const
inline

Definition at line 101 of file t_type.h.

virtual bool t_type::is_base_type ( ) const
inlinevirtual

Reimplemented in t_base_type.

Definition at line 61 of file t_type.h.

virtual bool t_type::is_bool ( ) const
inlinevirtual

Reimplemented in t_base_type.

Definition at line 70 of file t_type.h.

virtual bool t_type::is_container ( ) const
inlinevirtual

Reimplemented in t_container.

Definition at line 75 of file t_type.h.

virtual bool t_type::is_enum ( ) const
inlinevirtual

Reimplemented in t_enum.

Definition at line 72 of file t_type.h.

virtual bool t_type::is_list ( ) const
inlinevirtual

Reimplemented in t_list.

Definition at line 76 of file t_type.h.

virtual bool t_type::is_map ( ) const
inlinevirtual

Reimplemented in t_map.

Definition at line 78 of file t_type.h.

virtual bool t_type::is_service ( ) const
inlinevirtual

Reimplemented in t_service.

Definition at line 79 of file t_type.h.

virtual bool t_type::is_set ( ) const
inlinevirtual

Reimplemented in t_set.

Definition at line 77 of file t_type.h.

virtual bool t_type::is_string ( ) const
inlinevirtual

Reimplemented in t_base_type.

Definition at line 62 of file t_type.h.

virtual bool t_type::is_struct ( ) const
inlinevirtual

Reimplemented in t_struct.

Definition at line 73 of file t_type.h.

virtual bool t_type::is_typedef ( ) const
inlinevirtual

Reimplemented in t_typedef.

Definition at line 71 of file t_type.h.

virtual bool t_type::is_void ( ) const
inlinevirtual

Reimplemented in t_base_type.

Definition at line 60 of file t_type.h.

virtual bool t_type::is_xception ( ) const
inlinevirtual

Reimplemented in t_struct.

Definition at line 74 of file t_type.h.

static char t_type::nybble_to_xdigit ( int  num)
inlinestatic

Definition at line 124 of file t_type.h.

virtual void t_type::set_name ( const std::string &  name)
inlinevirtual

Reimplemented in t_enum.

Definition at line 52 of file t_type.h.

Member Data Documentation

std::map<std::string, std::string> t_type::annotations_

Definition at line 171 of file t_type.h.

uint8_t t_type::fingerprint_[fingerprint_len]
protected

Definition at line 203 of file t_type.h.

const int t_type::fingerprint_len = 16
static

Definition at line 96 of file t_type.h.

std::string t_type::name_
protected

Definition at line 201 of file t_type.h.

t_program* t_type::program_
protected

Definition at line 200 of file t_type.h.


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