Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Representations/JoystickData.cpp

Go to the documentation of this file.

    00001 /**
    00002  * @file JoystickData.cpp
    00003  * Implementation of class JoystickData.
    00004  *
    00005  * @author <a href=mailto:dueffert@informatik.hu-berlin.de>Uwe Düffert</a>
    00006  */
    00007
    00008 #include "JoystickData.h"
    00009 #include "Platform/SystemCall.h"
    00010 #include "Representations/Motion/MotionRequest.h"
    00011
    00012 JoystickData::JoystickData():x(0),y(0),z(0),accel(0),button(0),coolie(0),directSpecialAction(false),specialActionID(SpecialActionRequest::numOfSpecialAction)
    00013 {
    00014   timeStamp = SystemCall::getCurrentSystemTime();
    00015 }
    00016
    00017 In& operator>>(In& stream,JoystickData& joystickData)
    00018 {
    00019   joystickData.timeStamp = SystemCall::getCurrentSystemTime();
    00020   int directSpecialAction, specialActionID;
    00021   stream >> joystickData.x >> joystickData.y >> joystickData.z >> joystickData.accel >> joystickData.button >> joystickData.coolie >> directSpecialAction >> specialActionID;
    00022   joystickData.directSpecialAction = directSpecialAction!=0;
    00023   joystickData.specialActionID = (SpecialActionRequest::SpecialActionID)specialActionID;
    00024   return stream;
    00025 }
    00026
    00027 Out& operator<<(Out& stream, const JoystickData& joystickData)
    00028 {
    00029   stream << joystickData.x << joystickData.y << joystickData.z << joystickData.accel << joystickData.button << joystickData.coolie << (int)joystickData.directSpecialAction << (int)joystickData.specialActionID;
    00030   return stream;
    00031 }