summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstorri <storri@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-03-20 16:26:03 +0000
committerstorri <storri@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-03-20 16:26:03 +0000
commit398d7f80677b8459d3044d1d2a018b75086e5a44 (patch)
tree90d9290bb5cb20d12f38c765c642c10e39f8d621
parent0773de98e3166ea82f16369a9b8871b1a988ab42 (diff)
downloadATCD-398d7f80677b8459d3044d1d2a018b75086e5a44.tar.gz
Revised ACE_Timeprobe class to follow the ACE_Hash_Map_Manager_Ex class so that
there would be backward compatibility with the older ACE_Timeprobes.
-rw-r--r--ace/Metrics_Cache_T.cpp8
-rw-r--r--ace/README4
-rw-r--r--ace/Timeprobe.h9
-rw-r--r--ace/Timeprobe_T.cpp53
-rw-r--r--ace/Timeprobe_T.h24
-rw-r--r--ace/config-vxworks5.x.h1
6 files changed, 55 insertions, 44 deletions
diff --git a/ace/Metrics_Cache_T.cpp b/ace/Metrics_Cache_T.cpp
index 4fa64430a58..ed32042a1b3 100644
--- a/ace/Metrics_Cache_T.cpp
+++ b/ace/Metrics_Cache_T.cpp
@@ -64,7 +64,7 @@ ACE_Metrics_Timeprobe (ALLOCATOR *alloc,
const char *name,
u_long size)
:
- ACE_Timeprobe<ACE_LOCK, ALLOCATOR> (size),
+ ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR> (size),
id_ (id),
name_ (0)
{
@@ -157,9 +157,6 @@ template <class ACE_LOCK, class ALLOCATOR> void
ACE_Metrics_Timeprobe<ACE_LOCK, ALLOCATOR>::
flush_ACE_Metrics_Timeprobe ()
{
-#if defined (VXWORKS)
- // TBD - implement this
-#endif
}
@@ -232,9 +229,6 @@ template <class ACE_LOCK, class ALLOCATOR> void
ACE_Metrics_Cache<ACE_LOCK, ALLOCATOR>::
flush_ACE_Metrics_Cache ()
{
-#if defined (VXWORKS)
- // TBD - implement this
-#endif
}
diff --git a/ace/README b/ace/README
index 07555825c1f..d363e8b27ea 100644
--- a/ace/README
+++ b/ace/README
@@ -207,6 +207,10 @@ ACE_HAS_BROKEN_DGRAM_SENDV Platform sendv() does not work
properly with datagrams,
i.e. it fails when the iovec
size is IOV_MAX.
+ACE_HAS_BROKEN_DES_ARRAY_FREE There is a compiler bug for VxWORKS
+ (gcc version 2.96-PentiumIII-99112
+ Tornado 2) which cannot handle the
+ cast for timeprobes_addr()
ACE_HAS_BROKEN_ENUMS Compiler can't handle large
enums (e.g., HP/UX C++)
ACE_HAS_BROKEN_HPUX_TEMPLATES Earlier versions of HP/UX C++
diff --git a/ace/Timeprobe.h b/ace/Timeprobe.h
index 8d546ce985f..0a9a3033598 100644
--- a/ace/Timeprobe.h
+++ b/ace/Timeprobe.h
@@ -40,6 +40,7 @@
#include "ace/pre.h"
#include "ace/OS.h"
+#include "ace/Malloc_Allocator.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -123,9 +124,9 @@ typedef ACE_SYNCH_MUTEX ACE_TIMEPROBE_MUTEX;
typedef ACE_SYNCH_NULL_MUTEX ACE_TIMEPROBE_MUTEX;
# endif /* ACE_MT_TIMEPROBES */
-typdef ACE_New_Allocator ACE_TIMEPROBE_ALLOCATOR;
+typedef ACE_New_Allocator ACE_TIMEPROBE_ALLOCATOR;
-typedef ACE_Timeprobe<ACE_TIMEPROBE_MUTEX, ACE_TIMEPROBE_ALLOCATOR>
+typedef ACE_Timeprobe_Ex<ACE_TIMEPROBE_MUTEX, ACE_TIMEPROBE_ALLOCATOR>
ACE_TIMEPROBE_WITH_LOCKING;
// If ACE_TSS_TIMEPROBES is defined, store the ACE_Timeprobe singleton
@@ -144,8 +145,8 @@ typedef ACE_Singleton<ACE_TIMEPROBE_WITH_LOCKING, ACE_SYNCH_MUTEX>
ACE_TIMEPROBE_SINGLETON;
# endif /* ACE_TSS_TIMEPROBES */
-typedef ACE_TIMEPROBE_SINGLETON_TYPE<ACE_TIMEPROBE_WITH_LOCKING, ACE_TIMEPROBE_SINGLETON_LOCK_TYPE>
- ACE_TIMEPROBE_SINGLETON;
+//typedef ACE_TIMEPROBE_SINGLETON_TYPE<ACE_TIMEPROBE_WITH_LOCKING, ACE_TIMEPROBE_SINGLETON_LOCK_TYPE>
+// ACE_TIMEPROBE_SINGLETON;
ACE_SINGLETON_DECLARE (ACE_TIMEPROBE_SINGLETON_TYPE, \
ACE_TIMEPROBE_WITH_LOCKING, \
diff --git a/ace/Timeprobe_T.cpp b/ace/Timeprobe_T.cpp
index 2c18490e3b6..8b9dd010399 100644
--- a/ace/Timeprobe_T.cpp
+++ b/ace/Timeprobe_T.cpp
@@ -17,7 +17,7 @@ ACE_RCSID(ace, Timeprobe_T, "$Id$")
#include "ace/High_Res_Timer.h"
template <class ACE_LOCK, class ALLOCATOR>
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::ACE_Timeprobe (u_long size)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::ACE_Timeprobe_Ex (u_long size)
: timeprobes_ (0),
lock_ (),
max_size_ (size),
@@ -36,8 +36,8 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::ACE_Timeprobe (u_long size)
}
template <class ACE_LOCK, class ALLOCATOR>
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::
-ACE_Timeprobe (ALLOCATOR *allocator,
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::
+ACE_Timeprobe_Ex (ALLOCATOR *allocator,
u_long size)
: timeprobes_ (0),
lock_ (),
@@ -57,7 +57,7 @@ ACE_Timeprobe (ALLOCATOR *allocator,
}
template <class ACE_LOCK, class ALLOCATOR>
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::ACE_Timeprobe (const ACE_Timeprobe<ACE_LOCK> &)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::ACE_Timeprobe_Ex (const ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR> &)
{
//
// Stupid MSVC is forcing me to define this; please don't use it.
@@ -69,9 +69,9 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::ACE_Timeprobe (const ACE_Timeprobe<ACE_LOCK>
}
template <class ACE_LOCK, class ALLOCATOR>
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::~ACE_Timeprobe (void)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::~ACE_Timeprobe_Ex (void)
{
-#if defined (VXWORKS)
+#if defined (ACE_HAS_BROKEN_DES_ARRAY_FREE)
ACE_DES_ARRAY_FREE ( (this->timeprobes_),
this->max_size_,
this->allocator ()->free,
@@ -85,7 +85,7 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::~ACE_Timeprobe (void)
}
template <class ACE_LOCK, class ALLOCATOR> void
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::timeprobe (u_long event)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::timeprobe (u_long event)
{
ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
@@ -112,7 +112,7 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::timeprobe (u_long event)
}
template <class ACE_LOCK, class ALLOCATOR> void
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::timeprobe (const char *event)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::timeprobe (const char *event)
{
ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
@@ -129,7 +129,7 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::timeprobe (const char *event)
}
template <class ACE_LOCK, class ALLOCATOR> void
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::reset (void)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::reset (void)
{
ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
@@ -138,7 +138,7 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::reset (void)
}
template <class ACE_LOCK, class ALLOCATOR> void
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::increase_size (u_long size)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::increase_size (u_long size)
{
ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
@@ -163,7 +163,7 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::increase_size (u_long size)
// There is a compiler bug for VxWorks (gcc version 2.96-PentiumIII-991112 Tornado 2)
// which cannot handle the cast for timeprobes_addr()
-#if defined (VXWORKS)
+#if defined (ACE_HAS_BROKEN_DES_ARRAY_FREE)
ACE_DES_ARRAY_FREE (
(this->timeprobes_),
this->max_size_,
@@ -184,43 +184,43 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::increase_size (u_long size)
}
template <class ACE_LOCK, class ALLOCATOR> ACE_Unbounded_Set<ACE_Event_Descriptions> &
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::event_descriptions (void)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::event_descriptions (void)
{
return this->event_descriptions_;
}
template <class ACE_LOCK, class ALLOCATOR> ACE_Unbounded_Set<ACE_Event_Descriptions> &
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::sorted_event_descriptions (void)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::sorted_event_descriptions (void)
{
return this->sorted_event_descriptions_;
}
template <class ACE_LOCK, class ALLOCATOR> ACE_timeprobe_t *
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::timeprobes (void)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::timeprobes (void)
{
return this->timeprobes_;
}
template <class ACE_LOCK, class ALLOCATOR> ACE_LOCK &
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::lock (void)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::lock (void)
{
return this->lock_;
}
template <class ACE_LOCK, class ALLOCATOR> u_long
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::max_size (void)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::max_size (void)
{
return this->max_size_;
}
template <class ACE_LOCK, class ALLOCATOR> u_long
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::current_size (void)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::current_size (void)
{
return this->current_size_;
}
template <class ACE_LOCK, class ALLOCATOR> int
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::event_descriptions (const char **descriptions,
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::event_descriptions (const char **descriptions,
u_long minimum_id)
{
ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
@@ -235,7 +235,7 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::event_descriptions (const char **description
}
template <class ACE_LOCK, class ALLOCATOR> void
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::print_times (void)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::print_times (void)
{
ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
@@ -243,7 +243,7 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::print_times (void)
this->sort_event_descriptions_i ();
ACE_DEBUG ((LM_DEBUG,
- "\nACE_Timeprobe; %d timestamps were recorded:\n",
+ "\nACE_Timeprobe_Ex; %d timestamps were recorded:\n",
this->current_size_));
if (this->current_size_ == 0)
@@ -261,7 +261,6 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::print_times (void)
this->timeprobes_[0].thread_,
"START"));
- ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
u_long i, j;
if (report_buffer_full_ == 0) {
@@ -295,7 +294,7 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::print_times (void)
}
template <class ACE_LOCK, class ALLOCATOR> void
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::print_absolute_times (void)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::print_absolute_times (void)
{
ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
@@ -303,7 +302,7 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::print_absolute_times (void)
this->sort_event_descriptions_i ();
ACE_DEBUG ((LM_DEBUG,
- "\nACE_Timeprobe; %d timestamps were recorded:\n",
+ "\nACE_Timeprobe_Ex; %d timestamps were recorded:\n",
this->current_size_));
if (this->current_size_ == 0 && this->report_buffer_full_ == 0) {
@@ -338,7 +337,7 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::print_absolute_times (void)
}
template <class ACE_LOCK, class ALLOCATOR> const char *
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::find_description_i (u_long i)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::find_description_i (u_long i)
{
if (this->timeprobes_[i].event_type_ == ACE_timeprobe_t::STRING) {
return this->timeprobes_[i].event_.event_description_;
@@ -361,7 +360,7 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::find_description_i (u_long i)
}
template <class ACE_LOCK, class ALLOCATOR> void
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::sort_event_descriptions_i (void)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::sort_event_descriptions_i (void)
{
size_t total_elements = this->event_descriptions_.size ();
@@ -384,9 +383,9 @@ ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::sort_event_descriptions_i (void)
}
template <class ACE_LOCK, class ALLOCATOR> ALLOCATOR *
-ACE_Timeprobe<ACE_LOCK, ALLOCATOR>::allocator (void)
+ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>::allocator (void)
{
- return allocator_ ? allocator_ : ACE_Singleton<ACE_LOCK, ALLOCATOR>::instance ();
+ return allocator_ ? allocator_ : ACE_Singleton<ALLOCATOR, ACE_LOCK>::instance ();
}
template <class Timeprobe>
diff --git a/ace/Timeprobe_T.h b/ace/Timeprobe_T.h
index 2d7ef3dd032..45ca973bf94 100644
--- a/ace/Timeprobe_T.h
+++ b/ace/Timeprobe_T.h
@@ -56,12 +56,12 @@
* that multiple tables do not share the same event id range.
*/
template <class ACE_LOCK, class ALLOCATOR>
-class ACE_Timeprobe
+class ACE_Timeprobe_Ex
{
public:
/// Self
- typedef ACE_Timeprobe<ACE_LOCK, ALLOCATOR>
+ typedef ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR>
SELF;
/// We can hold multiple event description tables.
@@ -69,13 +69,13 @@ public:
EVENT_DESCRIPTIONS;
/// Create Timeprobes with <size> slots
- ACE_Timeprobe (u_long size = ACE_DEFAULT_TIMEPROBE_TABLE_SIZE);
+ ACE_Timeprobe_Ex (u_long size = ACE_DEFAULT_TIMEPROBE_TABLE_SIZE);
/// Create Timeprobes with <size> slots
- ACE_Timeprobe (ALLOCATOR *allocator,
+ ACE_Timeprobe_Ex (ALLOCATOR *allocator,
u_long size = ACE_DEFAULT_TIMEPROBE_TABLE_SIZE);
/// Destructor.
- ~ACE_Timeprobe (void);
+ ~ACE_Timeprobe_Ex (void);
/// Record a time. <event> is used to describe this time probe.
void timeprobe (u_long event);
@@ -99,7 +99,7 @@ public:
void increase_size (u_long size);
/// Not implemented (stupid MSVC won't let it be protected).
- ACE_Timeprobe (const ACE_Timeprobe<ACE_LOCK> &);
+ ACE_Timeprobe_Ex (const ACE_Timeprobe_Ex<ACE_LOCK, ALLOCATOR> &);
// = (Somewhat private) Accessors
@@ -162,6 +162,18 @@ private:
ALLOCATOR * allocator_;
};
+template <class ACE_LOCK>
+class ACE_Timeprobe : public ACE_Timeprobe_Ex <ACE_LOCK, ACE_Allocator>
+{
+public:
+ // Initialize a ACE_Timeprobe with default size
+ ACE_Timeprobe (ACE_Allocator *allocator = 0);
+
+ /// Create Timeprobes with <size> slots
+ ACE_Timeprobe (ACE_Allocator *allocator = 0,
+ u_long size = ACE_DEFAULT_TIMEPROBE_TABLE_SIZE);
+};
+
/**
* @class ACE_Function_Timeprobe
*
diff --git a/ace/config-vxworks5.x.h b/ace/config-vxworks5.x.h
index d4b42f231bc..c1ddbe9a999 100644
--- a/ace/config-vxworks5.x.h
+++ b/ace/config-vxworks5.x.h
@@ -102,6 +102,7 @@
#define ACE_HAS_BROKEN_ACCEPT_ADDR
#define ACE_HAS_BROKEN_SENDMSG
#define ACE_HAS_BROKEN_WRITEV
+#define ACE_HAS_BROKEN_DES_ARRAY_FREE
#define ACE_HAS_CHARPTR_SOCKOPT
#define ACE_HAS_CLOCK_GETTIME
#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES