ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR > Class Template Reference

This class implements a timeprobe for use in a Metrics framework. More...

#include <Metrics_Cache_T.h>

Inheritance diagram for ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >:

Inheritance graph
[legend]
Collaboration diagram for ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Metrics_Timeprobe<
ACE_LOCK, ALLOCATOR > 
ACE_METRICS_TIMEPROBE_TYPE
typedef ACE_timeprobe_t ACE_METRICS_TIMEPROBE_DATA_TYPE
typedef ACE_METRICS_TIMEPROBE_TYPEACE_METRICS_TIMEPROBE_BASED_PTR_TYPE
typedef char * ACE_METRICS_NAME_BASED_PTR_TYPE
enum  event_id { WORK_START = 0, WORK_STOP = 1, WORK_SUSPEND = 2, WORK_RESUME = 3 }

Public Member Functions

 ACE_Metrics_Timeprobe (u_int id=0, const char *name=0, u_long size=METRICS_DEFAULT_TIMEPROBE_TABLE_SIZE)
 ACE_Metrics_Timeprobe (ALLOCATOR *allocatorPtr, u_int id=0, const char *name=0, u_long size=METRICS_DEFAULT_TIMEPROBE_TABLE_SIZE)
virtual ~ACE_Metrics_Timeprobe ()
int is_event (const ACE_METRICS_TIMEPROBE_DATA_TYPE &t, ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::event_id id)
const char * probe_name (void)
void probe_name (char *name)
u_int probe_id (void)
void probe_id (u_int id)
void flush_ACE_Metrics_Timeprobe ()

Protected Attributes

u_int id_
char * name_

Private Member Functions

 ACE_Metrics_Timeprobe (const ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR > &)
void operator= (const ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR > &)

Detailed Description

template<class ACE_LOCK, class ALLOCATOR>
class ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >

This class implements a timeprobe for use in a Metrics framework.

This class provides a probe for specific thread and method call metrics timing points.

Definition at line 46 of file Metrics_Cache_T.h.


Member Typedef Documentation

template<class ACE_LOCK, class ALLOCATOR>
typedef char* ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::ACE_METRICS_NAME_BASED_PTR_TYPE
 

Definition at line 56 of file Metrics_Cache_T.h.

template<class ACE_LOCK, class ALLOCATOR>
typedef ACE_METRICS_TIMEPROBE_TYPE* ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::ACE_METRICS_TIMEPROBE_BASED_PTR_TYPE
 

Definition at line 55 of file Metrics_Cache_T.h.

template<class ACE_LOCK, class ALLOCATOR>
typedef ACE_timeprobe_t ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::ACE_METRICS_TIMEPROBE_DATA_TYPE
 

Definition at line 54 of file Metrics_Cache_T.h.

Referenced by ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::is_event().

template<class ACE_LOCK, class ALLOCATOR>
typedef ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR> ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::ACE_METRICS_TIMEPROBE_TYPE
 

Definition at line 52 of file Metrics_Cache_T.h.


Member Enumeration Documentation

template<class ACE_LOCK, class ALLOCATOR>
enum ACE_Metrics_Timeprobe::event_id
 

Enumeration values:
WORK_START 
WORK_STOP 
WORK_SUSPEND 
WORK_RESUME 

Definition at line 59 of file Metrics_Cache_T.h.

00060   {
00061     WORK_START = 0,
00062     WORK_STOP = 1,
00063     WORK_SUSPEND = 2,
00064     WORK_RESUME = 3
00065   };


Constructor & Destructor Documentation

template<class ACE_LOCK, class ALLOCATOR>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::ACE_Metrics_Timeprobe u_int  id = 0,
const char *  name = 0,
u_long  size = METRICS_DEFAULT_TIMEPROBE_TABLE_SIZE
 

Definition at line 35 of file Metrics_Cache_T.cpp.

References ACE_NEW_MALLOC_ARRAY, event_description_strings, ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::event_descriptions(), and ACE_OS::memcpy().

00038   :
00039     ACE_Timeprobe<ACE_LOCK> (size),
00040     id_ (id),
00041     name_ (0)
00042 {
00043   if (name == 0)
00044     {
00045       name = "";
00046     }
00047 
00048   char * name_tmp = 0;
00049   ACE_NEW_MALLOC_ARRAY (name_tmp,
00050                         (char *) this->allocator ()->malloc (strlen(name)+1),
00051                         char,
00052                         strlen(name)+1);
00053   ACE_OS::memcpy (name_tmp, name, strlen (name)+1);
00054   name_ = name_tmp;
00055 
00056   this->event_descriptions (event_description_strings,
00057                             sizeof(event_description_strings)/sizeof(const char *));
00058 }

template<class ACE_LOCK, class ALLOCATOR>
ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::ACE_Metrics_Timeprobe ALLOCATOR *  allocatorPtr,
u_int  id = 0,
const char *  name = 0,
u_long  size = METRICS_DEFAULT_TIMEPROBE_TABLE_SIZE
 

Definition at line 62 of file Metrics_Cache_T.cpp.

References ACE_NEW_MALLOC_ARRAY, event_description_strings, ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::event_descriptions(), and ACE_OS::memcpy().

00066   :
00067         ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR> (size),
00068                 id_ (id),
00069     name_ (0)
00070 {
00071   if (name == 0)
00072     {
00073       name = "";
00074     }
00075 
00076   char * name_tmp = 0;
00077   ACE_NEW_MALLOC_ARRAY (name_tmp,
00078                         (char *) alloc->malloc(strlen(name)+1),
00079                         char,
00080                         strlen(name)+1);
00081   ACE_OS::memcpy (name_tmp, name, strlen (name)+1);
00082   name_ = name_tmp;
00083 
00084   this->event_descriptions (event_description_strings,
00085                             sizeof(event_description_strings)/sizeof(const char *));
00086 }

template<class ACE_LOCK, class ALLOCATOR>
ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::~ACE_Metrics_Timeprobe  )  [virtual]
 

Definition at line 89 of file Metrics_Cache_T.cpp.

References ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::allocator().

00090 {
00091    if (name_)
00092     {
00093          this->allocator ()->free ((void*) name_);
00094     }
00095 }

template<class ACE_LOCK, class ALLOCATOR>
ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::ACE_Metrics_Timeprobe const ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR > &   )  [private]
 


Member Function Documentation

template<class ACE_LOCK, class ALLOCATOR>
void ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::flush_ACE_Metrics_Timeprobe  ) 
 

Definition at line 158 of file Metrics_Cache_T.cpp.

00159 {
00160 }

template<class ACE_LOCK, class ALLOCATOR>
int ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::is_event const ACE_METRICS_TIMEPROBE_DATA_TYPE t,
ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::event_id  id
 

Definition at line 102 of file Metrics_Cache_T.cpp.

References ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::ACE_METRICS_TIMEPROBE_DATA_TYPE.

00108 {
00109   return (t.event_.event_number_ ==  (u_long) id) ? 1 : 0;
00110 }

template<class ACE_LOCK, class ALLOCATOR>
void ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::operator= const ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR > &   )  [private]
 

template<class ACE_LOCK, class ALLOCATOR>
void ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::probe_id u_int  id  ) 
 

Definition at line 148 of file Metrics_Cache_T.cpp.

References ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::id_.

00149 {
00150   id_ = id;
00151 }

template<class ACE_LOCK, class ALLOCATOR>
u_int ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::probe_id void   ) 
 

Definition at line 140 of file Metrics_Cache_T.cpp.

References ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::id_.

00141 {
00142   return id_;
00143 }

template<class ACE_LOCK, class ALLOCATOR>
void ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::probe_name char *  name  ) 
 

Definition at line 121 of file Metrics_Cache_T.cpp.

References ACE_NEW_MALLOC_ARRAY, ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::allocator(), and ACE_OS::memcpy().

00122 {
00123   char * name_tmp = 0;
00124   ACE_NEW_MALLOC_ARRAY (name_tmp,
00125                         (char *) this->allocator ()->malloc (strlen(name)+1),
00126                         char,
00127                         strlen(name)+1);
00128   ACE_OS::memcpy (name_tmp, name, strlen (name)+1);
00129 
00130   if (name_)
00131   {
00132      this->allocator ()->free (name_);
00133   }
00134 
00135   name_ = name_tmp;
00136 }

template<class ACE_LOCK, class ALLOCATOR>
const char * ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::probe_name void   ) 
 

Definition at line 114 of file Metrics_Cache_T.cpp.

00115 {
00116    return name_;
00117 }


Member Data Documentation

template<class ACE_LOCK, class ALLOCATOR>
u_int ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::id_ [protected]
 

Definition at line 101 of file Metrics_Cache_T.h.

Referenced by ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::probe_id().

template<class ACE_LOCK, class ALLOCATOR>
char* ACE_Metrics_Timeprobe< ACE_LOCK, ALLOCATOR >::name_ [protected]
 

Definition at line 104 of file Metrics_Cache_T.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:24:59 2006 for ACE by doxygen 1.3.6