tudocomp
– The TU Dortmund Compression Framework
tdc::Meta Class Reference

Provides meta information about an Algorithm. More...

#include <Meta.hpp>

Classes

class  OptionBuilder
 Helper for declaring accepted options in algorithm meta information. More...
 

Public Member Functions

 Meta (const std::string &type, const std::string &name, const std::string &doc="")
 Constructs an algorithm meta object with the given information. More...
 
OptionBuilder option (const std::string &name)
 Declares an accepted option for this algorithm. More...
 
const std::string & name () const
 Returns the algorithm's name. More...
 
const std::string & type () const
 Returns the algorithm's type. More...
 
void input_restrictions (const io::InputRestrictions &restr)
 Places byte restrictions on the Input. More...
 
void needs_sentinel_terminator ()
 Indicates that this Algorithm requires a null terminator symbol in Input. More...
 
template<typename text_t >
void uses_textds (ds::dsflags_t flags)
 Indicates that this Algorithm uses the TextDS class, and how it does. More...
 

Friends

void gather_types (eval::AlgorithmTypes &target, Meta &&meta)
 

Detailed Description

Provides meta information about an Algorithm.

Any Algorithm must implement a static function meta() that returns an instance of this class, providing meta information about it.

The information is used for the automatic instantiation methods (e.g. create_algo) and for automatically generated documentation in the driver application.

It consists of an algorithm type, the name, additional documentation, accepted environment option and allows the definition of a hierarchy of algorithms. For instance, an algorithm may accept other algorithms of a type "strategy" as options, allowing for dynamic switching of strategies based on the application. Please refer to the tutorial documents for more information on this topic.

Definition at line 34 of file Meta.hpp.

Constructor & Destructor Documentation

tdc::Meta::Meta ( const std::string &  type,
const std::string &  name,
const std::string &  doc = "" 
)
inline

Constructs an algorithm meta object with the given information.

Parameters
typeThe algorithm type. This algorithm can be passed as an option to other algorithms that accept the same type.
nameThe name of the algorithm, used for the auto-generated documentation.
docFurther documentation text, used for the auto-generated documentation.

Definition at line 66 of file Meta.hpp.

Member Function Documentation

void tdc::Meta::input_restrictions ( const io::InputRestrictions restr)
inline

Places byte restrictions on the Input.

Definition at line 262 of file Meta.hpp.

const std::string& tdc::Meta::name ( ) const
inline

Returns the algorithm's name.

Returns
The algorithm's name.

Definition at line 251 of file Meta.hpp.

void tdc::Meta::needs_sentinel_terminator ( )
inline

Indicates that this Algorithm requires a null terminator symbol in Input.

Deprecated:

All occurrences of null in the input will be escaped, and an extra null will be appended to it.

Definition at line 271 of file Meta.hpp.

OptionBuilder tdc::Meta::option ( const std::string &  name)
inline

Declares an accepted option for this algorithm.

Parameters
nameThe option's name.

Definition at line 216 of file Meta.hpp.

const std::string& tdc::Meta::type ( ) const
inline

Returns the algorithm's type.

Returns
The algorithm's type.

Definition at line 257 of file Meta.hpp.

template<typename text_t >
void tdc::Meta::uses_textds ( ds::dsflags_t  flags)
inline

Indicates that this Algorithm uses the TextDS class, and how it does.

Definition at line 277 of file Meta.hpp.

Friends And Related Function Documentation

void gather_types ( eval::AlgorithmTypes &  target,
Meta &&  meta 
)
friend

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