Peekerpoke  0.1 beta
Car Class Reference

#include <Car.h>

Public Member Functions

 Car ()
 Default constructor of class Car. More...
 
 Car (string name)
 String constructor of class Car. More...
 
 ~Car ()
 Default destructor of class Car. More...
 
void adjustDirection ()
 Adjust the car direction according to the next positon. More...
 
MapgetMap ()
 getter function of m_map More...
 
MotorgetMotor ()
 getter function of m_motor More...
 
void startPeek (std::string ptr)
 New a peek class and start to do peek. More...
 
void forkThreadForPoke ()
 Fork a sub thread for poke. More...
 
void forkThreadForLocation ()
 Fork a thread for Location. More...
 

Private Attributes

string m_name
 
Map m_map
 
Motor m_motor
 
pthread_t pokeThread
 
pthread_t locationThread
 

Friends

void * startPoke (void *ptr)
 
void * startLocation (void *ptr)
 

Constructor & Destructor Documentation

Car::Car ( )

Default constructor of class Car.

Set the car name as "Car1" and fork a thread for poke

Car::Car ( string  name)

String constructor of class Car.

Set the car name from param and fork a thread for poke

Parameters
nameA string of the car name
Car::~Car ( )

Default destructor of class Car.

Cancel the thread of poke

Member Function Documentation

void Car::adjustDirection ( )

Adjust the car direction according to the next positon.

void Car::forkThreadForLocation ( )

Fork a thread for Location.

void Car::forkThreadForPoke ( )

Fork a sub thread for poke.

Map & Car::getMap ( )

getter function of m_map

Returns
the same object of the map
Motor & Car::getMotor ( )

getter function of m_motor

Returns
the same object of the motor
void Car::startPeek ( std::string  ptr)

New a peek class and start to do peek.

Format the peek text, Set the params of peek, judeg if data is received

Parameters
ptrA string of what to be sent out

Friends And Related Function Documentation

void* startLocation ( void *  ptr)
friend
void* startPoke ( void *  ptr)
friend

Member Data Documentation

pthread_t Car::locationThread
private
Map Car::m_map
private
Motor Car::m_motor
private
string Car::m_name
private
pthread_t Car::pokeThread
private

The documentation for this class was generated from the following files: