Skip to content

PLIBS_9 logo


pipeline status Latest release coverage report documentation Phoenix2 documentation phoenixtypestream conda channel DOI

Code

Source code is available here

Documentation

User documentation can be found here

Quick Start

This library is usefull to get the name of the class or the prototypes of functions in a reproductible way which does not depend on the compiler's implementation. In short typeid is broken and this library can fix it.

And if you want to add your own type and make it usable with the interface of PhoenixTypeStream you have to specialized the phoenix_getTypeName function :

#include "phoenix_type_stream.h"

struct Shadok{
    ///Age the Shadok
    int p_age;
    ///Name of the Shadok
    std::string name;
};

template<>
std::string phoenix_getTypeName<Shadok>(){
    return "Shadok";
}

Then you can call phoenix_getTypeToStr to get the name of any type as std::string, including this Shadok.

Code generator

You can also a PhoenixFileGenerator code generator to save time when you define data you want to exchange with classes.

Our previous example can be defined with a simple configuration in the file Shadok.pdata :

///@brief Test Shadok
Shadok {
    ///Age of the Shadok
    int age;
    ///Name of the Shadok
    std::string name;
}

Then, you can call :

phoenix_filegenerator class -c Shadok.pdata --typestream

To generate the corresponding Shadok class with the PhoenixTypeStream interface.

Installation

You can get the installation instructions from phoenix projects consistent installtion procedure.