00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef HxEnvironment_h
00012 #define HxEnvironment_h
00013
00014 #include "HxIo.h"
00015 #include "HxStd.h"
00016
00017
00018 class L_HXBASIS HxEnvironment {
00019 public:
00020 virtual ~HxEnvironment();
00021 static HxEnvironment* instance();
00022 static void setEnvironment(HxEnvironment* env);
00023
00024 virtual STD_OSTREAM& outputStream();
00025 virtual STD_OSTREAM& warningStream();
00026 virtual STD_OSTREAM& errorStream();
00027 virtual void flush();
00028 protected:
00029 HxEnvironment();
00030 private:
00031 static HxEnvironment* _inst;
00032 };
00033
00034
00035 #define HX_COUT HxEnvironment::instance()->outputStream()
00036 #define HX_CWARN HxEnvironment::instance()->warningStream()
00037 #define HX_CERR HxEnvironment::instance()->errorStream()
00038 #define HX_FLUSH HxEnvironment::instance()->flush()
00039
00040
00041 #endif