Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 8, 2005, 5:13:05 PM (18 years ago)
Author:
bwuest
Message:

Synchronizeable.h and Synchronizeable.cc changed: state and functions to get/set the state added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/synchronizeable.cc

    r5829 r5992  
    1212### File Specific:
    1313   main-programmer: Silvan Nellen
    14    co-programmer: ...
     14   co-programmer: Benjamin Wuest
    1515*/
    1616
     
    2323 */
    2424Synchronizeable::Synchronizeable()
    25 {}
     25{
     26
     27  //owner = ?;
     28  //hostID = ?;
     29  //state = ?;
     30
     31}
    2632
    2733/**
     
    5965void Synchronizeable::readDebug() const
    6066{}
     67
     68
     69
     70
     71
     72/**
     73 * Sets the server flag to a given value
     74 * @param isServer: the boolean value which the server flag is to set to
     75 */
     76void Synchronizeable::setIsServer(bool isServer)
     77{
     78  if( isServer )
     79    this->state = this->state | STATE_SERVER;
     80  else
     81    this->state = this->state & (~STATE_SERVER);
     82}
     83
     84/**
     85 * Sets the outofsync flag to a given value
     86 * @param outOfSync: the boolean value which the outofsync flag is to set to
     87 */
     88void Synchronizeable::setIsOutOfSync(bool outOfSync)
     89{
     90  if( outOfSync )
     91    this->state = this->state | STATE_OUTOFSYNC;
     92  else
     93    this->state = this->state & (~STATE_OUTOFSYNC);
     94}
     95
     96/**
     97 * Determines if the server flag is set
     98 * @return true, if the server flag is true, false else
     99 */
     100bool Synchronizeable::isServer()
     101{
     102  return this->state & STATE_SERVER == STATE_SERVER;
     103}
     104
     105/**
     106 * Determines if the outofsync flag is set
     107 * @return true, if the outofsync flag is true, false else
     108 */
     109bool Synchronizeable::isOutOfSync()
     110{
     111  return this->state & STATE_OUTOFSYNC == STATE_OUTOFSYNC;
     112}
Note: See TracChangeset for help on using the changeset viewer.