Changeset 51:ce21260a98d7 in rrlib_logging


Ignore:
Timestamp:
31.01.2011 13:28:24 (10 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Phase:
public
Convert:
svn:2179b62a-598e-4714-ba03-d8986cbf34aa/trunk@59
Message:

Reformatting to meet code templates

Files:
14 edited

Legend:

Unmodified
Added
Removed
  • definitions.h

    r48 r51  
    3939 */ 
    4040//---------------------------------------------------------------------- 
    41 #ifndef _rrlib_logging_definitions_h_ 
    42 #define _rrlib_logging_definitions_h_ 
     41#ifndef __rrlib__logging__definitions_h__ 
     42#define __rrlib__logging__definitions_h__ 
    4343 
    4444//---------------------------------------------------------------------- 
     
    4949// Internal includes with "" 
    5050//---------------------------------------------------------------------- 
    51 #define _rrlib_logging_include_guard_ 
     51#define __rrlib__logging__include_guard__ 
    5252 
    5353#include "rrlib/logging/tLogDomain.h" 
    5454#include "rrlib/logging/tLogDomainRegistry.h" 
    5555 
    56 #undef _rrlib_logging_include_guard_ 
     56#undef __rrlib__logging__include_guard__ 
    5757 
    5858//---------------------------------------------------------------------- 
  • tLogDomain.cpp

    r38 r51  
    2929 */ 
    3030//---------------------------------------------------------------------- 
    31 #define _rrlib_logging_include_guard_ 
     31#define __rrlib__logging__include_guard__ 
    3232#include "rrlib/logging/tLogDomain.h" 
    3333 
  • tLogDomain.h

    r50 r51  
    3939 */ 
    4040//---------------------------------------------------------------------- 
    41 #ifndef _rrlib_logging_include_guard_ 
     41#ifndef __rrlib__logging__include_guard__ 
    4242#error Invalid include directive. Try #include "rrlib/logging/definitions.h" instead. 
    4343#endif 
    4444 
    45 #ifndef _rrlib_logging_tLogDomain_h_ 
    46 #define _rrlib_logging_tLogDomain_h_ 
     45#ifndef __rrlib__logging__tLogDomain_h__ 
     46#define __rrlib__logging__tLogDomain_h__ 
    4747 
    4848//---------------------------------------------------------------------- 
  • tLogDomainConfiguration.cpp

    r41 r51  
    2828 */ 
    2929//---------------------------------------------------------------------- 
    30 #define _rrlib_logging_include_guard_ 
     30#define __rrlib__logging__include_guard__ 
    3131#include "rrlib/logging/tLogDomainConfiguration.h" 
    3232 
  • tLogDomainConfiguration.h

    r41 r51  
    5454 */ 
    5555//---------------------------------------------------------------------- 
    56 #ifndef _rrlib_logging_include_guard_ 
     56#ifndef __rrlib__logging__include_guard__ 
    5757#error Invalid include directive. Try #include "rrlib/logging/definitions.h" instead. 
    5858#endif 
    5959 
    60 #ifndef _rrlib_logging_tLogDomainConfiguration_h_ 
    61 #define _rrlib_logging_tLogDomainConfiguration_h_ 
     60#ifndef __rrlib__logging__tLogDomainConfiguration_h__ 
     61#define __rrlib__logging__tLogDomainConfiguration_h__ 
    6262 
    6363//---------------------------------------------------------------------- 
     
    128128  friend class tLogDomain; 
    129129 
     130//---------------------------------------------------------------------- 
     131// Private fields and methods 
     132//---------------------------------------------------------------------- 
     133private: 
     134 
    130135  std::string name; 
    131136  bool configure_sub_tree; 
  • tLogDomainRegistry.cpp

    r45 r51  
    2828 */ 
    2929//---------------------------------------------------------------------- 
    30 #define _rrlib_logging_include_guard_ 
     30#define __rrlib__logging__include_guard__ 
    3131#include "rrlib/logging/tLogDomainRegistry.h" 
    3232 
  • tLogDomainRegistry.h

    r40 r51  
    4141 */ 
    4242//---------------------------------------------------------------------- 
    43 #ifndef _rrlib_logging_include_guard_ 
     43#ifndef __rrlib__logging__include_guard__ 
    4444#error Invalid include directive. Try #include "rrlib/logging/definitions.h" instead. 
    4545#endif 
    4646 
    47 #ifndef _rrlib_logging_tLogDomainRegistry_h_ 
    48 #define _rrlib_logging_tLogDomainRegistry_h_ 
     47#ifndef __rrlib__logging__tLogDomainRegistry_h__ 
     48#define __rrlib__logging__tLogDomainRegistry_h__ 
    4949 
    5050//---------------------------------------------------------------------- 
     
    9494class tLogDomainRegistry 
    9595{ 
     96 
     97//---------------------------------------------------------------------- 
     98// Public methods and typedefs 
     99//---------------------------------------------------------------------- 
     100public: 
     101 
     102  /*! Get an instance of this class (singleton) 
     103   * 
     104   * Due to the singleton pattern this class has no public constructor. 
     105   * The only way to get an object is to call this method. 
     106   * 
     107   * \returns The only instance of this class that should exist 
     108   */ 
     109  static std::tr1::shared_ptr<tLogDomainRegistry> GetInstance(); 
     110 
     111  /*! Get the default domain 
     112   * 
     113   * There is always on default domain registered that can be accessed 
     114   * using this method as a shortcut. 
     115   * 
     116   * \returns The default domain object 
     117   */ 
     118  static inline tLogDomainSharedPointer GetDefaultDomain() 
     119  { 
     120    return GetInstance()->domains[0]; 
     121  } 
     122 
     123  /*! Get a subdomain with given name and parent. 
     124   * 
     125   * This method can be used to access a subdomain of the given parent 
     126   * with given name. It then implements the lookup and if the domain 
     127   * was not found creates a new one and applies an eventually existing 
     128   * configuration. 
     129   * 
     130   * \param name     The name of the subdomain (local part) 
     131   * \param parent   The parent of the subdomain 
     132   * 
     133   * \returns The found or newly created domain object as a shared pointer 
     134   */ 
     135  tLogDomainSharedPointer GetSubDomain(const std::string &name, tLogDomainSharedPointer parent); 
     136 
     137  /*! Set a prefix for filenames that are created as log 
     138   * 
     139   * If their output stream is set to eMS_FILE domains create a log 
     140   * file with their name. Additionally, this name must have a prefix 
     141   * to distinguish between programs, processes or runs. 
     142   * 
     143   * The method could be called with basename(argv[0]) in main, for example. 
     144   * 
     145   * \param file_name_prefix   The string the should be used as prefix 
     146   */ 
     147  inline void SetOutputFileNamePrefix(const std::string &file_name_prefix) 
     148  { 
     149    assert(file_name_prefix.length() > 0); 
     150    this->file_name_prefix = file_name_prefix; 
     151  } 
     152 
     153  /*! Get the configured file name prefix 
     154   * 
     155   * Get the file name prefix that was configured 
     156   * 
     157   * \returns The stored prefix 
     158   */ 
     159  inline const std::string &GetOutputFileNamePrefix() const 
     160  { 
     161    return this->file_name_prefix; 
     162  } 
     163 
     164  /*! Set if columns in prefix output should be padded or not 
     165   * 
     166   * If the prefix output columns should be aligned, the fields for the 
     167   * domain name and message level are padded with spaces to the right. 
     168   * 
     169   * \param value   The new value of this flag 
     170   */ 
     171  inline void SetPadPrefixColumns(bool value) 
     172  { 
     173    this->pad_prefix_columns = value; 
     174  } 
     175 
     176  /*! Get if columns in prefix output should be padded or not 
     177   * 
     178   * If the prefix output columns should be aligned, the fields for the 
     179   * domain name and message level are padded with spaces to the right. 
     180   * 
     181   * \returns Whether the columns in prefix output should be padded or not 
     182   */ 
     183  inline const bool GetPadPrefixColumns() const 
     184  { 
     185    return this->pad_prefix_columns; 
     186  } 
     187 
     188  /*! Set if rows in output should be padded to start after the prefix or not 
     189   * 
     190   * For multiline output following line do not have a prefix. Thus, they start 
     191   * in the first column whearas the first row started right after the prefix. 
     192   * This flag allows to choose if subsequent lines should be padded to match the 
     193   * first row or not. 
     194   * 
     195   * \param value   The new value of this flag 
     196   */ 
     197  inline void SetPadMultiLineMessages(bool value) 
     198  { 
     199    this->pad_multi_line_messages = value; 
     200  } 
     201 
     202  /*! Get if rows in output should be padded to start after the prefix or not 
     203   * 
     204   * For multiline output following line do not have a prefix. Thus, they start 
     205   * in the first column whearas the first row started right after the prefix. 
     206   * This flag allows to choose if subsequent lines should be padded to match the 
     207   * first row or not. 
     208   * 
     209   * \returns Whether the rows should be padded or not 
     210   */ 
     211  inline const bool GetPadMultiLineMessages() const 
     212  { 
     213    return this->pad_multi_line_messages; 
     214  } 
     215 
     216  /*! Get the length of the longest full qualified domain name 
     217   * 
     218   * This method can be used for formatting user dialogs 
     219   * 
     220   * \returns The length of the longest domain name 
     221   */ 
     222  std::string::size_type GetMaxDomainNameLength() const 
     223  { 
     224    return this->max_domain_name_length; 
     225  } 
     226 
     227  /*! Set if the domain configures its subtree or not 
     228   * 
     229   * If set to true every configuration update to the given domain 
     230   * will be propagated to its subtree. 
     231   * 
     232   * \param name    The full qualified name of the domain 
     233   * \param value   The new value of the setting 
     234   */ 
     235  void SetDomainConfiguresSubTree(const std::string &name, bool value); 
     236 
     237  /*! Set if the domain should prepend the current time to each message 
     238   * 
     239   * If set to true every message will start with the current time 
     240   * 
     241   * \param name    The full qualified name of the domain 
     242   * \param value   The new value of the setting 
     243   */ 
     244  void SetDomainPrintsTime(const std::string &name, bool value); 
     245 
     246  /*! Set if the domain should prepend messages with its name 
     247   * 
     248   * If set to true every message will include the full qualified domain 
     249   * name 
     250   * 
     251   * \param name    The full qualified name of the domain 
     252   * \param value   The new value of the setting 
     253   */ 
     254  void SetDomainPrintsName(const std::string &name, bool value); 
     255 
     256  /*! Set if the domain should prepend messages with their level 
     257   * 
     258   * If set to true every message will include its level 
     259   * 
     260   * \param name    The full qualified name of the domain 
     261   * \param value   The new value of the setting 
     262   */ 
     263  void SetDomainPrintsLevel(const std::string &name, bool value); 
     264 
     265  /*! Set if the domain should prepend the message with its location 
     266   * 
     267   * If set to true every message will include its location in code. 
     268   * This is extremely helpful during debugging phases. 
     269   * 
     270   * \param name    The full qualified name of the domain 
     271   * \param value   The new value of the setting 
     272   */ 
     273  void SetDomainPrintsLocation(const std::string &name, bool value); 
     274 
     275  /*! Set the maximal message level of the given domain 
     276   * 
     277   * The output of each message that has a level above the given value 
     278   * will be suppressed. Default is eML_DEBUG or eML_WARNING depending on 
     279   * compile flags. 
     280   * 
     281   * \param name    The full qualified name of the domain 
     282   * \param value   The new value of the setting 
     283   */ 
     284  void SetDomainMaxMessageLevel(const std::string &name, tLogLevel value); 
     285 
     286  /*! Set the output streams that should be used as sink by the given domain 
     287   * 
     288   * \param name     The full qualified name of the domain 
     289   * \param sink_1   The first sink to be used by the given domain 
     290   * \param sink_2   The second sink to be used by the given domain 
     291   * \param sink_3   The third sink to be used by the given domain 
     292   * \param sink_4   The fourth sink to be used by the given domain 
     293   */ 
     294  void SetDomainSink(const std::string &name, tLogSink sink_1, tLogSink sink_2 = eLS_DIMENSION, tLogSink sink_3 = eLS_DIMENSION, tLogSink sink_4 = eLS_DIMENSION); 
     295 
     296  /*! Read domain configuration from a given XML file 
     297   * 
     298   * The overall configuration of the logging domains tends to be 
     299   * too complicated for a classical command line option interface. 
     300   * Therefore, it is possible to specify the configuration in form 
     301   * of an XML file following the DTD -//RRLIB//logging 
     302   * 
     303   * \param file_name   The XML file to be read 
     304   * 
     305   * \returns Whether the configuration could be read and applied or not 
     306   */ 
     307  bool ConfigureFromFile(const std::string &file_name); 
     308 
     309#ifdef _LIB_RRLIB_XML2_WRAPPER_PRESENT_ 
     310  /*! Read domain configuration from a given XML node 
     311   * 
     312   * Instead of reading and parsing an XML file dedicated to configure 
     313   * logging domains this method can be used after externally parsing 
     314   * a document that contains an rrlib_logging node following the DTD 
     315   * -//RRLIB//logging 
     316   * 
     317   * \param node   The XML node containing the configuration 
     318   * 
     319   * \returns Whether the configuration could be applied or not 
     320   */ 
     321  bool ConfigureFromXMLNode(const xml2::tXMLNode &node); 
     322#endif 
     323 
     324//---------------------------------------------------------------------- 
     325// Private fields and methods 
     326//---------------------------------------------------------------------- 
     327private: 
     328 
    96329  std::string file_name_prefix; 
    97330  std::vector<std::tr1::shared_ptr<tLogDomain> > domains; 
     
    161394#endif 
    162395 
    163 //---------------------------------------------------------------------- 
    164 // Public methods 
    165 //---------------------------------------------------------------------- 
    166 public: 
    167  
    168   /*! Get an instance of this class (singleton) 
    169    * 
    170    * Due to the singleton pattern this class has no public constructor. 
    171    * The only way to get an object is to call this method. 
    172    * 
    173    * \returns The only instance of this class that should exist 
    174    */ 
    175   static std::tr1::shared_ptr<tLogDomainRegistry> GetInstance(); 
    176  
    177   /*! Get the default domain 
    178    * 
    179    * There is always on default domain registered that can be accessed 
    180    * using this method as a shortcut. 
    181    * 
    182    * \returns The default domain object 
    183    */ 
    184   static inline tLogDomainSharedPointer GetDefaultDomain() 
    185   { 
    186     return GetInstance()->domains[0]; 
    187   } 
    188  
    189   /*! Get a subdomain with given name and parent. 
    190    * 
    191    * This method can be used to access a subdomain of the given parent 
    192    * with given name. It then implements the lookup and if the domain 
    193    * was not found creates a new one and applies an eventually existing 
    194    * configuration. 
    195    * 
    196    * \param name     The name of the subdomain (local part) 
    197    * \param parent   The parent of the subdomain 
    198    * 
    199    * \returns The found or newly created domain object as a shared pointer 
    200    */ 
    201   tLogDomainSharedPointer GetSubDomain(const std::string &name, tLogDomainSharedPointer parent); 
    202  
    203   /*! Set a prefix for filenames that are created as log 
    204    * 
    205    * If their output stream is set to eMS_FILE domains create a log 
    206    * file with their name. Additionally, this name must have a prefix 
    207    * to distinguish between programs, processes or runs. 
    208    * 
    209    * The method could be called with basename(argv[0]) in main, for example. 
    210    * 
    211    * \param file_name_prefix   The string the should be used as prefix 
    212    */ 
    213   inline void SetOutputFileNamePrefix(const std::string &file_name_prefix) 
    214   { 
    215     assert(file_name_prefix.length() > 0); 
    216     this->file_name_prefix = file_name_prefix; 
    217   } 
    218  
    219   /*! Get the configured file name prefix 
    220    * 
    221    * Get the file name prefix that was configured 
    222    * 
    223    * \returns The stored prefix 
    224    */ 
    225   inline const std::string &GetOutputFileNamePrefix() const 
    226   { 
    227     return this->file_name_prefix; 
    228   } 
    229  
    230   /*! Set if columns in prefix output should be padded or not 
    231    * 
    232    * If the prefix output columns should be aligned, the fields for the 
    233    * domain name and message level are padded with spaces to the right. 
    234    * 
    235    * \param value   The new value of this flag 
    236    */ 
    237   inline void SetPadPrefixColumns(bool value) 
    238   { 
    239     this->pad_prefix_columns = value; 
    240   } 
    241  
    242   /*! Get if columns in prefix output should be padded or not 
    243    * 
    244    * If the prefix output columns should be aligned, the fields for the 
    245    * domain name and message level are padded with spaces to the right. 
    246    * 
    247    * \returns Whether the columns in prefix output should be padded or not 
    248    */ 
    249   inline const bool GetPadPrefixColumns() const 
    250   { 
    251     return this->pad_prefix_columns; 
    252   } 
    253  
    254   /*! Set if rows in output should be padded to start after the prefix or not 
    255    * 
    256    * For multiline output following line do not have a prefix. Thus, they start 
    257    * in the first column whearas the first row started right after the prefix. 
    258    * This flag allows to choose if subsequent lines should be padded to match the 
    259    * first row or not. 
    260    * 
    261    * \param value   The new value of this flag 
    262    */ 
    263   inline void SetPadMultiLineMessages(bool value) 
    264   { 
    265     this->pad_multi_line_messages = value; 
    266   } 
    267  
    268   /*! Get if rows in output should be padded to start after the prefix or not 
    269    * 
    270    * For multiline output following line do not have a prefix. Thus, they start 
    271    * in the first column whearas the first row started right after the prefix. 
    272    * This flag allows to choose if subsequent lines should be padded to match the 
    273    * first row or not. 
    274    * 
    275    * \returns Whether the rows should be padded or not 
    276    */ 
    277   inline const bool GetPadMultiLineMessages() const 
    278   { 
    279     return this->pad_multi_line_messages; 
    280   } 
    281  
    282   /*! Get the length of the longest full qualified domain name 
    283    * 
    284    * This method can be used for formatting user dialogs 
    285    * 
    286    * \returns The length of the longest domain name 
    287    */ 
    288   std::string::size_type GetMaxDomainNameLength() const 
    289   { 
    290     return this->max_domain_name_length; 
    291   } 
    292  
    293   /*! Set if the domain configures its subtree or not 
    294    * 
    295    * If set to true every configuration update to the given domain 
    296    * will be propagated to its subtree. 
    297    * 
    298    * \param name    The full qualified name of the domain 
    299    * \param value   The new value of the setting 
    300    */ 
    301   void SetDomainConfiguresSubTree(const std::string &name, bool value); 
    302  
    303   /*! Set if the domain should prepend the current time to each message 
    304    * 
    305    * If set to true every message will start with the current time 
    306    * 
    307    * \param name    The full qualified name of the domain 
    308    * \param value   The new value of the setting 
    309    */ 
    310   void SetDomainPrintsTime(const std::string &name, bool value); 
    311  
    312   /*! Set if the domain should prepend messages with its name 
    313    * 
    314    * If set to true every message will include the full qualified domain 
    315    * name 
    316    * 
    317    * \param name    The full qualified name of the domain 
    318    * \param value   The new value of the setting 
    319    */ 
    320   void SetDomainPrintsName(const std::string &name, bool value); 
    321  
    322   /*! Set if the domain should prepend messages with their level 
    323    * 
    324    * If set to true every message will include its level 
    325    * 
    326    * \param name    The full qualified name of the domain 
    327    * \param value   The new value of the setting 
    328    */ 
    329   void SetDomainPrintsLevel(const std::string &name, bool value); 
    330  
    331   /*! Set if the domain should prepend the message with its location 
    332    * 
    333    * If set to true every message will include its location in code. 
    334    * This is extremely helpful during debugging phases. 
    335    * 
    336    * \param name    The full qualified name of the domain 
    337    * \param value   The new value of the setting 
    338    */ 
    339   void SetDomainPrintsLocation(const std::string &name, bool value); 
    340  
    341   /*! Set the maximal message level of the given domain 
    342    * 
    343    * The output of each message that has a level above the given value 
    344    * will be suppressed. Default is eML_DEBUG or eML_WARNING depending on 
    345    * compile flags. 
    346    * 
    347    * \param name    The full qualified name of the domain 
    348    * \param value   The new value of the setting 
    349    */ 
    350   void SetDomainMaxMessageLevel(const std::string &name, tLogLevel value); 
    351  
    352   /*! Set the output streams that should be used as sink by the given domain 
    353    * 
    354    * \param name     The full qualified name of the domain 
    355    * \param sink_1   The first sink to be used by the given domain 
    356    * \param sink_2   The second sink to be used by the given domain 
    357    * \param sink_3   The third sink to be used by the given domain 
    358    * \param sink_4   The fourth sink to be used by the given domain 
    359    */ 
    360   void SetDomainSink(const std::string &name, tLogSink sink_1, tLogSink sink_2 = eLS_DIMENSION, tLogSink sink_3 = eLS_DIMENSION, tLogSink sink_4 = eLS_DIMENSION); 
    361  
    362   /*! Read domain configuration from a given XML file 
    363    * 
    364    * The overall configuration of the logging domains tends to be 
    365    * too complicated for a classical command line option interface. 
    366    * Therefore, it is possible to specify the configuration in form 
    367    * of an XML file following the DTD -//RRLIB//logging 
    368    * 
    369    * \param file_name   The XML file to be read 
    370    * 
    371    * \returns Whether the configuration could be read and applied or not 
    372    */ 
    373   bool ConfigureFromFile(const std::string &file_name); 
    374  
    375 #ifdef _LIB_RRLIB_XML2_WRAPPER_PRESENT_ 
    376   /*! Read domain configuration from a given XML node 
    377    * 
    378    * Instead of reading and parsing an XML file dedicated to configure 
    379    * logging domains this method can be used after externally parsing 
    380    * a document that contains an rrlib_logging node following the DTD 
    381    * -//RRLIB//logging 
    382    * 
    383    * \param node   The XML node containing the configuration 
    384    * 
    385    * \returns Whether the configuration could be applied or not 
    386    */ 
    387   bool ConfigureFromXMLNode(const xml2::tXMLNode &node); 
    388 #endif 
    389  
    390396}; 
    391397 
  • tLogStream.h

    r42 r51  
    4848 */ 
    4949//---------------------------------------------------------------------- 
    50 #ifndef _rrlib_logging_include_guard_ 
     50#ifndef __rrlib__logging__include_guard__ 
    5151#error Invalid include directive. Try #include "rrlib/logging/definitions.h" instead. 
    5252#endif 
    5353 
    54 #ifndef _rrlib_logging_tLogStream_h_ 
    55 #define _rrlib_logging_tLogStream_h_ 
     54#ifndef __rrlib__logging__tLogStream_h__ 
     55#define __rrlib__logging__tLogStream_h__ 
    5656 
    5757//---------------------------------------------------------------------- 
     
    108108class tLogStream 
    109109{ 
    110   std::tr1::shared_ptr<tLogStreamContext> stream_context; 
    111  
    112   // Prohibit assignment 
    113   tLogStream &operator = (const tLogStream &other); 
    114  
    115   // Prohibit creation on heap 
    116   void *operator new(size_t size); 
    117  
    118 //---------------------------------------------------------------------- 
    119 // Public methods 
     110 
     111//---------------------------------------------------------------------- 
     112// Public methods and typedefs 
    120113//---------------------------------------------------------------------- 
    121114public: 
     
    464457  } 
    465458 
     459 
     460//---------------------------------------------------------------------- 
     461// Private fields and methods 
     462//---------------------------------------------------------------------- 
     463private: 
     464 
     465  std::tr1::shared_ptr<tLogStreamContext> stream_context; 
     466 
     467  // Prohibit assignment 
     468  tLogStream &operator = (const tLogStream &other); 
     469 
     470  // Prohibit creation on heap 
     471  void *operator new(size_t size); 
     472 
    466473}; 
    467474 
  • tLogStreamBuffer.cpp

    r38 r51  
    2828 */ 
    2929//---------------------------------------------------------------------- 
    30 #define _rrlib_logging_include_guard_ 
     30#define __rrlib__logging__include_guard__ 
    3131#include "rrlib/logging/tLogStreamBuffer.h" 
    3232 
  • tLogStreamBuffer.h

    r38 r51  
    4343 */ 
    4444//---------------------------------------------------------------------- 
    45 #ifndef _rrlib_logging_include_guard_ 
     45#ifndef __rrlib__logging__include_guard__ 
    4646#error Invalid include directive. Try #include "rrlib/logging/definitions.h" instead. 
    4747#endif 
    4848 
    49 #ifndef _rrlib_logging_tLogStreamBuffer_h_ 
    50 #define _rrlib_logging_tLogStreamBuffer_h_ 
     49#ifndef __rrlib__logging__tLogStreamBuffer_h__ 
     50#define __rrlib__logging__tLogStreamBuffer_h__ 
    5151 
    5252//---------------------------------------------------------------------- 
     
    116116class tLogStreamBuffer : public std::streambuf 
    117117{ 
    118   std::vector<std::streambuf *> buffers; 
    119  
    120   bool ends_with_newline; 
    121  
    122   size_t multi_line_pad_width; 
    123   bool collect_multi_line_pad_width; 
    124   bool pad_before_next_character; 
    125  
    126   int WriteCharacterToBuffers(int c); 
    127  
    128   virtual int overflow(int c); 
    129  
    130   virtual int sync(); 
    131  
    132 //---------------------------------------------------------------------- 
    133 // Public methods 
     118 
     119//---------------------------------------------------------------------- 
     120// Public methods and typedefs 
    134121//---------------------------------------------------------------------- 
    135122public: 
     
    186173  void MarkEndOfPrefixForMultiLinePadding(); 
    187174 
     175//---------------------------------------------------------------------- 
     176// Private fields and methods 
     177//---------------------------------------------------------------------- 
     178private: 
     179 
     180  std::vector<std::streambuf *> buffers; 
     181 
     182  bool ends_with_newline; 
     183 
     184  size_t multi_line_pad_width; 
     185  bool collect_multi_line_pad_width; 
     186  bool pad_before_next_character; 
     187 
     188  int WriteCharacterToBuffers(int c); 
     189 
     190  virtual int overflow(int c); 
     191 
     192  virtual int sync(); 
     193 
    188194}; 
    189195 
  • tLogStreamContext.h

    r41 r51  
    4747 */ 
    4848//---------------------------------------------------------------------- 
    49 #ifndef _rrlib_logging_include_guard_ 
     49#ifndef __rrlib__logging__include_guard__ 
    5050#error Invalid include directive. Try #include "rrlib/logging/definitions.h" instead. 
    5151#endif 
    5252 
    53 #ifndef rrlib_logging_tLogStreamContext_h_ 
    54 #define rrlib_logging_tLogStreamContext_h_ 
     53#ifndef __rrlib__logging__tLogStreamContext_h__ 
     54#define __rrlib__logging__tLogStreamContext_h__ 
    5555 
    5656//---------------------------------------------------------------------- 
     
    102102class tLogStreamContext 
    103103{ 
    104   std::ostream stream; 
    105  
    106   boost::recursive_mutex *mutex; 
    107  
    108   // Prohibit copy 
    109   tLogStreamContext(const tLogStreamContext &other); 
    110  
    111   // Prohibit assignment 
    112   tLogStreamContext &operator = (const tLogStreamContext &other); 
    113104 
    114105//---------------------------------------------------------------------- 
     
    155146  } 
    156147 
     148//---------------------------------------------------------------------- 
     149// Private fields and methods 
     150//---------------------------------------------------------------------- 
     151private: 
     152 
     153  std::ostream stream; 
     154 
     155  boost::recursive_mutex *mutex; 
     156 
     157  // Prohibit copy 
     158  tLogStreamContext(const tLogStreamContext &other); 
     159 
     160  // Prohibit assignment 
     161  tLogStreamContext &operator = (const tLogStreamContext &other); 
     162 
    157163}; 
    158164 
  • test/debugging.h

    r38 r51  
    3434 */ 
    3535//---------------------------------------------------------------------- 
    36 #ifndef _rrlib_logging_test_debugging_h_ 
    37 #define _rrlib_logging_test_debugging_h_ 
     36#ifndef __rrlib_logging__test__debugging_h__ 
     37#define __rrlib_logging__test__debugging_h__ 
    3838 
    3939//---------------------------------------------------------------------- 
  • test/libA/libA.h

    r38 r51  
    1 #ifndef LIBA_H_ 
    2 #define LIBA_H_ 
     1#ifndef _LIBA_H_ 
     2#define _LIBA_H_ 
    33 
    44#include "rrlib/logging/definitions.h" 
  • test/libB/libB.h

    r38 r51  
    1 #ifndef LIBB_H_ 
    2 #define LIBB_H_ 
     1#ifndef _LIBB_H_ 
     2#define _LIBB_H_ 
    33 
    44#include "rrlib/logging/definitions.h" 
Note: See TracChangeset for help on using the changeset viewer.