Skip to content

PLIBS_9 logo


pipeline status Latest release coverage report documentation Phoenix2 documentation

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";
}

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.

Requirements

  • c++ compiler (tested with g++ 11,12,13 and clang >= 14)
  • PhoenixCMake
  • cmake > 3
  • make

Installation for Users

git clone https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/serialize-io/PhoenixTypeStream
cd PhoenixTypeStream
./install.sh

Then PhoenixTypeStream is installed in your $HOME/usr.

If you prefer a customized install path you can do :

git clone https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/serialize-io/PhoenixTypeStream
cd PhoenixTypeStream
./install.sh /your/install/path

If you prefer a customized install path with custom compilation you can do :

git clone https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/serialize-io/PhoenixTypeStream
cd PhoenixTypeStream
mkdir -p build
cd build
cmake .. $(phoenixcmake-config --cmake)
make -j `nproc`
make install -j `nproc`

The nproc gives the number of cores of the computer. If you want a build on one core you can just type :

make
make install

Update PhoenixTypeStream

If you want to update the software :

git clone https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/serialize-io/PhoenixTypeStream
cd PhoenixTypeStream
./update.sh

If you want to update the software with a custom install path :

git clone https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS2/serialize-io/PhoenixTypeStream
cd PhoenixTypeStream
./update.sh /your/install/path