Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

NML_PERFORMANCE_TEST_MSG Class Reference

#include <perftype.hh>

Inheritance diagram for NML_PERFORMANCE_TEST_MSG:

Inheritance graph
[legend]
Collaboration diagram for NML_PERFORMANCE_TEST_MSG:

Collaboration graph
[legend]

Public Methods

 NML_PERFORMANCE_TEST_MSG ()
void update (CMS *)
void compute_array_length ()
void * operator new (size_t)
void operator delete (void *)

Data Fields

int serial_number
int test_type
long array_length
char char_data
short short_data
int int_data
long long_data
float float_data
double double_data

Constructor & Destructor Documentation

NML_PERFORMANCE_TEST_MSG::NML_PERFORMANCE_TEST_MSG   [inline]
 

Definition at line 19 of file perftype.hh.

00019                              :NMLmsg (NML_PERFORMANCE_TEST_MSG_TYPE,
00020                                       sizeof (NML_PERFORMANCE_TEST_MSG))
00021   {
00022   };


Member Function Documentation

void NML_PERFORMANCE_TEST_MSG::update CMS   cms
 

Reimplemented from NMLmsg.

Definition at line 47 of file perftype.cc.

00048 {
00049   cms->update (serial_number);
00050   cms->update (test_type);
00051   cms->update (array_length);
00052   switch (test_type)
00053     {
00054     case CHAR_TEST:
00055       cms->update (&char_data, (array_length > 0) ? array_length : 1);
00056       break;
00057     case SHORT_TEST:
00058       cms->update (&short_data, (array_length > 0) ? array_length : 1);
00059       break;
00060     case INT_TEST:
00061       cms->update (&int_data, (array_length > 0) ? array_length : 1);
00062       break;
00063     case LONG_TEST:
00064       cms->update (&long_data, (array_length > 0) ? array_length : 1);
00065       break;
00066     case FLOAT_TEST:
00067       cms->update (&float_data, (array_length > 0) ? array_length : 1);
00068       break;
00069     case DOUBLE_TEST:
00070       cms->update (&double_data, (array_length > 0) ? array_length : 1);
00071       break;
00072     }
00073 }

void NML_PERFORMANCE_TEST_MSG::compute_array_length  
 

Definition at line 76 of file perftype.cc.

Referenced by nml_perf_combined_test(), and nml_perf_write_test().

00077 {
00078   long array_unit_size, base_size, org_size;
00079   org_size = size;
00080 
00081   switch (test_type)
00082     {
00083     case CHAR_TEST:
00084       array_unit_size = sizeof (char);
00085       break;
00086     case SHORT_TEST:
00087       array_unit_size = sizeof (short);
00088       break;
00089     case INT_TEST:
00090       array_unit_size = sizeof (int);
00091       break;
00092     case LONG_TEST:
00093       array_unit_size = sizeof (long);
00094       break;
00095     case FLOAT_TEST:
00096       array_unit_size = sizeof (float);
00097       break;
00098     case DOUBLE_TEST:
00099       array_unit_size = sizeof (double);
00100       break;
00101     default:
00102       rcs_print_error ("PERFTYPE: Invalid test type. (%ld)\n", test_type);
00103       array_unit_size = 1;
00104       break;
00105     }
00106   base_size = sizeof (NML_PERFORMANCE_TEST_MSG) - sizeof (double);
00107   array_length = (size - base_size) / array_unit_size;
00108   if (array_length > 0)
00109     {
00110       size = array_length * array_unit_size + base_size;
00111     }
00112   else
00113     {
00114       rcs_print_error
00115         ("NML_PERFORMANCE_TEST_MSG::compute_array_length() - array_length <= 0\n");
00116     }
00117 }

void * NML_PERFORMANCE_TEST_MSG::operator new size_t    size
 

Definition at line 120 of file perftype.cc.

00121 {
00122   if (test_msg_buffer_size > size && test_msg_buffer_size > real_test_msg_size
00123       && test_msg_buffer != NULL)
00124     {
00125       return test_msg_buffer;
00126     }
00127   if (test_msg_buffer != NULL)
00128     {
00129       corrected_free (test_msg_buffer);
00130       test_msg_buffer = NULL;
00131     }
00132   if (real_test_msg_size > size)
00133     {
00134       test_msg_buffer_size = real_test_msg_size;
00135       return (test_msg_buffer = calloc (real_test_msg_size, 1));
00136     }
00137   test_msg_buffer_size = size;
00138   return (test_msg_buffer = calloc (size, 1));
00139 }

void NML_PERFORMANCE_TEST_MSG::operator delete void *    ptr
 

Definition at line 142 of file perftype.cc.

00143 {
00144   if (ptr != test_msg_buffer && ptr != NULL)
00145     {
00146       corrected_free (ptr);
00147     }
00148 }


Field Documentation

int NML_PERFORMANCE_TEST_MSG::serial_number
 

Definition at line 24 of file perftype.hh.

Referenced by nml_perf_combined_test(), and nml_perf_write_test().

int NML_PERFORMANCE_TEST_MSG::test_type
 

Definition at line 25 of file perftype.hh.

Referenced by nml_perf_combined_test(), and nml_perf_write_test().

long NML_PERFORMANCE_TEST_MSG::array_length
 

Definition at line 26 of file perftype.hh.

Referenced by nml_perf_combined_test(), and nml_perf_write_test().

char NML_PERFORMANCE_TEST_MSG::char_data
 

Definition at line 31 of file perftype.hh.

short NML_PERFORMANCE_TEST_MSG::short_data
 

Definition at line 32 of file perftype.hh.

int NML_PERFORMANCE_TEST_MSG::int_data
 

Definition at line 33 of file perftype.hh.

long NML_PERFORMANCE_TEST_MSG::long_data
 

Definition at line 34 of file perftype.hh.

float NML_PERFORMANCE_TEST_MSG::float_data
 

Definition at line 35 of file perftype.hh.

double NML_PERFORMANCE_TEST_MSG::double_data
 

Definition at line 36 of file perftype.hh.


The documentation for this class was generated from the following files:
Generated on Sun Dec 2 15:58:50 2001 for rcslib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001