1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Class: Class():Sensor(),rsensor(),rvelocity(){}

Discussion in 'C' started by Suraine, Jan 18, 2008.

  1. Suraine

    Suraine Banned

    Joined:
    Jan 18, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Dear c++ gurus, i have thk all over wat is means by the following hightlighted text, but not understood, can anyone explain to me what do they mean? or how do they function?
    Code:
          class RotationSensor : public Sensor {
          public:
    
          RotationSensor(const Port port, int position = 0)
               : Sensor((Sensor::Port) port, true),
                rsensor((port == S1) ? ROTATION_1 :
               (port == S2) ? ROTATION_2 :
                ROTATION_3)
       
         #ifdef CONF_DSENSOR_VELOCITY
                  ,
                 rvelocity((port == S1) ? VELOCITY_1 :
                              (port == S2) ? VELOCITY_2 :
                              VELOCITY_3)
         #endif // CONF_DSENSOR_VELOCITY
           {
           on(); //! Turn on tracking of the sensor
           pos(position); //! Set the current position
           }
     
          ..........................................................
           }
    
    
    How does the following function/run/do/etc?

    RotationSensor(...) : Sensor (...), rsensor(...), rvelocity(...)
    {
    on();
    pos(position);
    }


    wat does this block of codes represent? or do? or how it function?

    Thanks guru.
     
    Last edited by a moderator: Jan 18, 2008

Share This Page