tree-gen
C++ code generator for tree structures
Public Member Functions | Public Attributes | List of all members
tree_gen::Specification Class Reference

Struct containing everything needed for a complete specification. More...

Public Member Functions

void set_source_doc (const std::string &doc)
 Sets the source file documentation. More...
 
void set_header_doc (const std::string &doc)
 Sets the header file documentation. More...
 
void set_header_fname (const std::string &fname)
 Sets the header filename for the #include directive. More...
 
void set_python_doc (const std::string &doc)
 Sets the Python file documentation. More...
 
void set_tree_namespace (const std::string &name_space)
 Sets the tree namespace. More...
 
void set_support_namespace (const std::string &name_space)
 Sets the support namespace. More...
 
void set_initialize_function (const std::string &init_fn)
 Sets the initialization function. More...
 
void set_serdes_functions (const std::string &ser_fn, const std::string &des_fn)
 Sets the serialization/deserialization functions. More...
 
void set_source_location (const std::string &ident)
 Sets the source location object. More...
 
void add_include (const std::string &include)
 Adds an include statement to the header file. More...
 
void add_src_include (const std::string &include)
 Adds an include statement to the source file. More...
 
void add_python_include (const std::string &include)
 Adds an import statement to the Python file. More...
 
void add_namespace (const std::string &name_space, const std::string &doc="")
 Adds a namespace level. More...
 
void add_node (std::shared_ptr< NodeBuilder > &node_builder)
 Adds the given node. More...
 
void build ()
 Checks for errors, resolves node names, and builds the nodes vector. More...
 

Public Attributes

std::string source_doc
 Source file documentation. More...
 
std::string header_doc
 Header file documentation. More...
 
std::string header_fname
 Explicit filename for the header, in case it will not end up in the same directory that the source is compiled from. More...
 
std::string python_doc
 Python file documentation. More...
 
std::vector< std::string > includes
 The include statements to stick at the top of the header file. More...
 
std::vector< std::string > src_includes
 The include statements to stick at the top of the source file. More...
 
std::vector< std::string > python_includes
 The include statements to stick at the top of the Python file. More...
 
std::string namespace_doc
 Namespace documentation. More...
 
std::vector< std::string > namespaces
 The C++ namespaces to use. More...
 
std::string tree_namespace
 The namespace to take the tree base types from. More...
 
std::string support_namespace
 The namespace to take support stuff like tree::cbor from. More...
 
std::string initialize_function
 The initialization function to use for default values of members. More...
 
std::string serialize_fn
 The serialization function to use when serializing primitives. More...
 
std::string py_serialize_fn
 Serialization function to use when serializing primitives in the Python domain, using . More...
 
std::string deserialize_fn
 The serialization function to use when deserializing primitives. More...
 
std::string py_deserialize_fn
 Deserialization function to use when serializing primitives in the Python domain, using . More...
 
std::string source_location
 Annotation object used for source location info, or empty if source locations are not used or are not to be generated (applies to the dumper only). More...
 
Nodes nodes
 All the nodes. More...
 

Detailed Description

Struct containing everything needed for a complete specification.

Definition at line 850 of file tree-gen.hpp.

#include <tree-gen.hpp>

Collaboration diagram for tree_gen::Specification:
Collaboration graph
[legend]

Member Function Documentation

◆ set_source_doc()

void tree_gen::Specification::set_source_doc ( const std::string &  doc)

Sets the source file documentation.

Definition at line 162 of file tree-gen.cpp.

◆ set_header_doc()

void tree_gen::Specification::set_header_doc ( const std::string &  doc)

Sets the header file documentation.

Definition at line 169 of file tree-gen.cpp.

◆ set_header_fname()

void tree_gen::Specification::set_header_fname ( const std::string &  fname)

Sets the header filename for the #include directive.

Definition at line 176 of file tree-gen.cpp.

◆ set_python_doc()

void tree_gen::Specification::set_python_doc ( const std::string &  doc)

Sets the Python file documentation.

Definition at line 183 of file tree-gen.cpp.

◆ set_tree_namespace()

void tree_gen::Specification::set_tree_namespace ( const std::string &  name_space)

Sets the tree namespace.

Definition at line 190 of file tree-gen.cpp.

◆ set_support_namespace()

void tree_gen::Specification::set_support_namespace ( const std::string &  name_space)

Sets the support namespace.

Definition at line 200 of file tree-gen.cpp.

◆ set_initialize_function()

void tree_gen::Specification::set_initialize_function ( const std::string &  init_fn)

Sets the initialization function.

Definition at line 210 of file tree-gen.cpp.

◆ set_serdes_functions()

void tree_gen::Specification::set_serdes_functions ( const std::string &  ser_fn,
const std::string &  des_fn 
)

Sets the serialization/deserialization functions.

Definition at line 220 of file tree-gen.cpp.

◆ set_source_location()

void tree_gen::Specification::set_source_location ( const std::string &  ident)

Sets the source location object.

Definition at line 233 of file tree-gen.cpp.

◆ add_include()

void tree_gen::Specification::add_include ( const std::string &  include)

Adds an include statement to the header file.

Definition at line 243 of file tree-gen.cpp.

◆ add_src_include()

void tree_gen::Specification::add_src_include ( const std::string &  include)

Adds an include statement to the source file.

Definition at line 250 of file tree-gen.cpp.

◆ add_python_include()

void tree_gen::Specification::add_python_include ( const std::string &  include)

Adds an import statement to the Python file.

Definition at line 257 of file tree-gen.cpp.

◆ add_namespace()

void tree_gen::Specification::add_namespace ( const std::string &  name_space,
const std::string &  doc = "" 
)

Adds a namespace level.

Definition at line 264 of file tree-gen.cpp.

◆ add_node()

void tree_gen::Specification::add_node ( std::shared_ptr< NodeBuilder > &  node_builder)

Adds the given node.

Definition at line 274 of file tree-gen.cpp.

◆ build()

void tree_gen::Specification::build ( )

Checks for errors, resolves node names, and builds the nodes vector.

Definition at line 285 of file tree-gen.cpp.

Member Data Documentation

◆ source_doc

std::string tree_gen::Specification::source_doc

Source file documentation.

Definition at line 863 of file tree-gen.hpp.

◆ header_doc

std::string tree_gen::Specification::header_doc

Header file documentation.

Definition at line 868 of file tree-gen.hpp.

◆ header_fname

std::string tree_gen::Specification::header_fname

Explicit filename for the header, in case it will not end up in the same directory that the source is compiled from.

Definition at line 874 of file tree-gen.hpp.

◆ python_doc

std::string tree_gen::Specification::python_doc

Python file documentation.

Definition at line 879 of file tree-gen.hpp.

◆ includes

std::vector<std::string> tree_gen::Specification::includes

The include statements to stick at the top of the header file.

Definition at line 884 of file tree-gen.hpp.

◆ src_includes

std::vector<std::string> tree_gen::Specification::src_includes

The include statements to stick at the top of the source file.

Definition at line 889 of file tree-gen.hpp.

◆ python_includes

std::vector<std::string> tree_gen::Specification::python_includes

The include statements to stick at the top of the Python file.

Definition at line 894 of file tree-gen.hpp.

◆ namespace_doc

std::string tree_gen::Specification::namespace_doc

Namespace documentation.

Definition at line 899 of file tree-gen.hpp.

◆ namespaces

std::vector<std::string> tree_gen::Specification::namespaces

The C++ namespaces to use.

Definition at line 904 of file tree-gen.hpp.

◆ tree_namespace

std::string tree_gen::Specification::tree_namespace

The namespace to take the tree base types from.

Definition at line 909 of file tree-gen.hpp.

◆ support_namespace

std::string tree_gen::Specification::support_namespace

The namespace to take support stuff like tree::cbor from.

Definition at line 914 of file tree-gen.hpp.

◆ initialize_function

std::string tree_gen::Specification::initialize_function

The initialization function to use for default values of members.

Definition at line 919 of file tree-gen.hpp.

◆ serialize_fn

std::string tree_gen::Specification::serialize_fn

The serialization function to use when serializing primitives.

If empty, no serdes logic should be generated.

Definition at line 925 of file tree-gen.hpp.

◆ py_serialize_fn

std::string tree_gen::Specification::py_serialize_fn

Serialization function to use when serializing primitives in the Python domain, using .

instead of :: for namespace separation.

Definition at line 931 of file tree-gen.hpp.

◆ deserialize_fn

std::string tree_gen::Specification::deserialize_fn

The serialization function to use when deserializing primitives.

Definition at line 936 of file tree-gen.hpp.

◆ py_deserialize_fn

std::string tree_gen::Specification::py_deserialize_fn

Deserialization function to use when serializing primitives in the Python domain, using .

instead of :: for namespace separation.

Definition at line 942 of file tree-gen.hpp.

◆ source_location

std::string tree_gen::Specification::source_location

Annotation object used for source location info, or empty if source locations are not used or are not to be generated (applies to the dumper only).

Definition at line 949 of file tree-gen.hpp.

◆ nodes

Nodes tree_gen::Specification::nodes

All the nodes.

Definition at line 954 of file tree-gen.hpp.


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