[Rock-dev] Types in Ruby, Constructor, initial values

Felix Rehrmann felix.rehrmann at dfki.de
Mon May 6 13:53:40 CEST 2013


Hi,

when instantiating Rock Types in Ruby like

a = Type::TypeToVector::PortConfig (defined like below)

the constructor is not called, so values are uninitialized.

Is there any way, to set initial values for a Rock type instantiated in 
ruby?

Felix


namespace type_to_vector {

struct PortConfig {

     std::string portname; //!< Name the port should have.
     std::string type; //!< Name of the type the port should handle.
     std::string slice; //!< Gives the part of a type that should be 
used in a vector.
     int vectorIdx; //!< The vector to add the port's data to.
     double period; //!< Sample rate in seconds. (0 if unknown or not 
periodic).
     bool useTimeNow; //!< Use time now to stamp unstamped data.

     PortConfig() :
         portname(""),
         type(""),
         slice(""),
         vectorIdx(0),
         period(0.0),
         useTimeNow(true) {}

};
}


More information about the Rock-dev mailing list