#include "DllMain.h"
#include <vector>
#include <map>
#include <iostream>
#include <sstream>
#include <pthread.h>
 
Go to the source code of this file.
      
        
          | #define ASSIGN_COUNTER | 
          ( | 
            | 
          counterName,  | 
        
        
           | 
           | 
            | 
          value  | 
        
        
           | 
          ) | 
           |    COUNTER( counterName ) = value; | 
        
      
 
 
      
        
          | #define COUNTER | 
          ( | 
            | 
          counterName | ) | 
             m_Counters[ #counterName ] | 
        
      
 
 
      
        
          | #define DESTROY_COUNTER | 
          ( | 
            | 
          counterName | ) | 
             if ( m_Counters.find( #counterName ) != m_Counters.end() ) ( void )m_Counters.erase( #counterName ) | 
        
      
 
 
      
        
          | #define INCREMENT_COUNTER | 
          ( | 
            | 
          counterName | ) | 
             COUNTER( counterName ) = COUNTER( counterName )+1 | 
        
      
 
 
      
        
          | #define INCREMENT_COUNTER_ON | 
          ( | 
            | 
          instance,  | 
        
        
           | 
           | 
            | 
          counterName  | 
        
        
           | 
          ) | 
           |    instance->COUNTER( counterName ) = instance->COUNTER( counterName )+1 | 
        
      
 
 
      
        
          | #define INCREMENT_COUNTER_ON_T | 
          ( | 
            | 
          instance,  | 
        
        
           | 
           | 
            | 
          counterName  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
      
        
          | #define INIT_COUNTER | 
          ( | 
            | 
          counterName | ) | 
             ( void )m_Counters.insert( pair< string, unsigned long >( #counterName, 0 ) ) | 
        
      
 
 
      
        
          | #define INIT_COUNTERS | 
          ( | 
            | 
          instrumented_obj,  | 
        
        
           | 
           | 
            | 
          intrumented_object_name  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Value:{\
        int mutexLockResult##intrumented_object_name = pthread_mutex_lock( &( InstrumentedObject::ObjMutex ) ); \
        if ( 0 != mutexLockResult##intrumented_object_name ) \
        { \
                TRACE( "Unable to lock mutex for "#intrumented_object_name" [" << mutexLockResult##intrumented_object_name << "]" ); \
        }; \
        InstrumentedObject::Instance.registerCounter( typeid( *this ).name(), "_"#instrumented_obj, instrumented_obj ); \
        int mutexUnlockResult##intrumented_object_name = pthread_mutex_unlock( &( InstrumentedObject::ObjMutex ) ); \
        if ( 0 != mutexUnlockResult##intrumented_object_name ) \
        { \
                TRACE( "Unable to unlock mutex for "#intrumented_object_name" [" << mutexUnlockResult##intrumented_object_name << "]" ); \
        }; \
}
 
 
 
      
        
          | #define RESET_COUNTER | 
          ( | 
            | 
          counterName | ) | 
             COUNTER( counterName ) = 0; |