C++ Systems

Top  Previous  Next

Systems that have their behavior implemented in C++. Most BasicMath systems (except for GainM and GainPY) are C++ systems.


Example of C++-System

As an example, following is an implementation of system Cos from BasicMath Component Library:


//@@ ***************************************************************************

// *

// * Copyright (C) 2011-2015, Timelike Systems

// *****************************************************************************



#include "timelike/timelike.h"


class Cos: public TL_PureFunction



 // Inputs

 TL_Input< double > u;


 // Outputs

 TL_Output< double > y;


 Cos(TL_System *parent, const char *name):

         TL_PureFunction(parent, name),

         u(this, "u"),

         y(this, "y")




 void respondToOutputRequest(TL_t_Output* var, TL_tTime t)


         if(var == &y)


                 double v = u.get(t);

                 double val = cos(v);

                 y.set(t, val);







Creating C++-System


The GUI Support for creating C++ Systems is planned to be included in the future release of TimeLike.