Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6698


Ignore:
Timestamp:
Apr 12, 2010, 5:08:27 PM (15 years ago)
Author:
smerkli
Message:

ChatHistory is not being constructed, no idea why.

Location:
code/branches/chat/src/orxonox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/chat/src/orxonox/CMakeLists.txt

    r6524 r6698  
    3232  PlayerManager.cc
    3333  Radar.cc
     34  ChatHistory.cc
    3435COMPILATION_BEGIN SceneCompilation.cc
    3536  CameraManager.cc
  • code/branches/chat/src/orxonox/ChatHistory.cc

    r6693 r6698  
    2828
    2929#include "ChatHistory.h"
     30#include "core/ScopedSingletonManager.h"
    3031
    31 #ifndef TEST
     32#ifndef CHATTEST
    3233namespace orxonox
    3334{
     35  /* singleton */
     36  ManageScopedSingleton( ChatHistory, ScopeID::Root, false );
    3437#endif
    3538
    3639  /* constructor */
    37 #ifndef TEST
     40#ifndef CHATTEST
    3841  ChatHistory(BaseObject* creator) : BaseObject(creator)
    3942#else
     
    4245  {
    4346    /* register the object */
    44 #ifndef TEST
     47#ifndef CHATTEST
    4548    RegisterObject(ChatHistory);
    4649#endif
     
    5558      this->chat_hist_logline( "--- Logfile opened ---" );
    5659    }
     60
     61    assert(0);
    5762
    5863    /* Read setting for maximum number of lines and set limit */
     
    7681    std::string text;
    7782
    78 #ifndef TEST
     83    COUT(0) << "Meow.\n";
     84
     85#ifndef CHATTEST
    7986    if (senderID != CLIENTID_UNKNOWN)
    8087    {
     
    104111    //if( this->hist_logfile )
    105112      //this->hist_logfile.sync();
     113    return 0;
    106114  }
    107115
     
    115123    /* push to the front of the history */
    116124    this->hist_buffer.push_back( toadd );
     125    return 0;
    117126  }
    118127
     
    123132    if( this->hist_log_enabled )
    124133      this->hist_logfile << toadd << std::endl;
     134    return 0;
    125135  }
    126136
     
    131141     *       and set the this->hist_logfile_path variable to it
    132142     */
    133 #ifndef TEST
     143#ifndef CHATTEST
    134144    this->hist_logfile.open( PathConfig::getInstance().getLogPathString() +
    135145      "chatlog.log",
     
    143153    if( !this->hist_logfile )
    144154    { this->hist_log_enabled = false;
    145 #ifndef TEST
     155#ifndef CHATTEST
    146156      COUT(2) << "Warning: Could not open logfile." << std::endl;
    147157#endif
     
    176186  }
    177187
    178 #ifndef TEST
     188#ifndef CHATTEST
    179189}
    180190#endif
  • code/branches/chat/src/orxonox/ChatHistory.h

    r6693 r6698  
    3131#include <fstream>
    3232#include <iostream>
     33#include <cassert>
    3334
    3435/* define this if you're unit testing */
    35 #define TEST 1
     36#define CHATTEST 0
    3637
    37 #ifndef TEST
     38#ifndef CHATTEST
    3839#include <core/BaseObject.h>
    3940#include <core/PathConfig.h>
     41#include <Singleton.h>
    4042#endif
    4143
     
    4547
    4648/* Class to implement chat history */
    47 #ifndef TEST
     49#ifndef CHATTEST
    4850namespace orxonox
    4951{
     
    5153
    5254  /* constructor */
    53 #ifndef TEST
    54   class _OrxonoxExport ChatHistory : public BaseObject, public ChatListener
     55#ifndef CHATTEST
     56  class _OrxonoxExport ChatHistory : public BaseObject, public ChatListener,
     57    public Singleton<ChatHistory>
     58
    5559#else
    5660  class ChatHistory
     
    5963    public:
    6064      /* constructors, destructors */
    61 #ifndef TEST
     65#ifndef CHATTEST
    6266      ChatHistory(BaseObject* creator);
     67      friend class Singleton<ChatHistory>;
    6368#else
    6469      ChatHistory();
     
    102107      std::ofstream hist_logfile;
    103108
     109#ifndef CHATTEST
     110      static ChatHistory* singletonPtr_s;
     111#endif
    104112
    105113
     
    131139  };
    132140
    133 #ifndef TEST
     141#ifndef CHATTEST
    134142}
    135143#endif
  • code/branches/chat/src/orxonox/graphics/CMakeLists.txt

    r6637 r6698  
    22  Billboard.cc
    33  BlinkingBillboard.cc
    4   ChatBox.cc
    54  FadingBillboard.cc
    65  GlobalShader.cc
Note: See TracChangeset for help on using the changeset viewer.