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

CMS_DISPLAY_ASCII_UPDATER Class Reference

#include <cms_dup.hh>

Inheritance diagram for CMS_DISPLAY_ASCII_UPDATER:

Inheritance graph
[legend]
Collaboration diagram for CMS_DISPLAY_ASCII_UPDATER:

Collaboration graph
[legend]

Public Methods

void find_next_comma ()
CMS_STATUS update_char (char &x)
CMS_STATUS update (char &x)
CMS_STATUS update (unsigned char &x)
CMS_STATUS update (short int &x)
CMS_STATUS update (unsigned short int &x)
CMS_STATUS update (int &x)
CMS_STATUS update (unsigned int &x)
CMS_STATUS update (long int &x)
CMS_STATUS update (unsigned long int &x)
CMS_STATUS update (float &x)
CMS_STATUS update (double &x)
CMS_STATUS update (long double &x)
CMS_STATUS update (char *x, unsigned int len)
CMS_STATUS update (unsigned char *x, unsigned int len)
CMS_STATUS update (short *x, unsigned int len)
CMS_STATUS update (unsigned short *x, unsigned int len)
CMS_STATUS update (int *x, unsigned int len)
CMS_STATUS update (unsigned int *x, unsigned int len)
CMS_STATUS update (long *x, unsigned int len)
CMS_STATUS update (unsigned long *x, unsigned int len)
CMS_STATUS update (float *x, unsigned int len)
CMS_STATUS update (double *x, unsigned int len)
CMS_STATUS update (long double *x, unsigned int len)
int set_mode (CMS_UPDATER_MODE)
void rewind ()
int get_encoded_msg_size ()

Protected Methods

int check_pointer (char RCS_HUGE *, long)
 CMS_DISPLAY_ASCII_UPDATER (CMS *)
virtual ~CMS_DISPLAY_ASCII_UPDATER ()

Protected Attributes

char * begin_current_string
char * end_current_string
long max_length_current_string
long length_current_string
int encoding
int warning_count
int warning_count_max
int updating_string

Friends

class RCS_EXPORT CMS

Constructor & Destructor Documentation

CMS_DISPLAY_ASCII_UPDATER::CMS_DISPLAY_ASCII_UPDATER CMS   _cms_parent [protected]
 

Definition at line 64 of file cms_dup.cc.

00064                                                                       :
00065 CMS_UPDATER (_cms_parent)
00066 {
00067   /* Set pointers to NULL. */
00068   begin_current_string = (char *) NULL;
00069   end_current_string = (char *) NULL;
00070   max_length_current_string = 0;
00071   updating_string = 0;
00072 
00073   /* Store and validate constructors arguments. */
00074   cms_parent = _cms_parent;
00075   if (NULL == cms_parent)
00076     {
00077       rcs_print_error ("CMS parent for updater is NULL.\n");
00078       return;
00079     }
00080 
00081   /* Allocate the encoded header too large, */
00082   /* and find out what size it really is. */
00083   encoded_header = malloc (neutral_size_factor * sizeof (CMS_HEADER));
00084   if (encoded_header == NULL)
00085     {
00086       rcs_print_error ("CMS:can't malloc encoded_header");
00087       status = CMS_CREATE_ERROR;
00088       return;
00089     }
00090 
00091   /* If queuing is enabled, then initialize streams for */
00092   /* encoding and decoding the header with the queue information. */
00093   if (cms_parent->queuing_enabled)
00094     {
00095       /* Allocate the encoded header too large, */
00096       /* and find out what size it really is. */
00097       encoded_queuing_header =
00098         malloc (neutral_size_factor * sizeof (CMS_QUEUING_HEADER));
00099     }
00100   using_external_encoded_data = 0;
00101   warning_count = 0;
00102   warning_count_max = DEFAULT_WARNING_COUNT_MAX;
00103 }

CMS_DISPLAY_ASCII_UPDATER::~CMS_DISPLAY_ASCII_UPDATER   [protected, virtual]
 

Definition at line 105 of file cms_dup.cc.

00106 {
00107   if (NULL != encoded_data && !using_external_encoded_data)
00108     {
00109       corrected_free (encoded_data);
00110       encoded_data = NULL;
00111     }
00112   if (NULL != encoded_header)
00113     {
00114       corrected_free (encoded_header);
00115       encoded_header = NULL;
00116     }
00117   if (NULL != encoded_queuing_header)
00118     {
00119       corrected_free (encoded_queuing_header);
00120       encoded_queuing_header = NULL;
00121     }
00122 }


Member Function Documentation

void CMS_DISPLAY_ASCII_UPDATER::find_next_comma  
 

Definition at line 125 of file cms_dup.cc.

Referenced by update().

00126 {
00127   while (*end_current_string != ',' && *end_current_string)
00128     {
00129       if (length_current_string >= max_length_current_string)
00130         {
00131           rcs_print_error ("Maximum string length exceeded.\n");
00132           status = CMS_UPDATE_ERROR;
00133           return;
00134         }
00135       length_current_string++;
00136       end_current_string++;
00137     }
00138   end_current_string++;
00139   length_current_string++;
00140 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update_char char &    x
 

Definition at line 264 of file cms_dup.cc.

Referenced by update().

00265 {
00266 
00267   if (encoding)
00268     {
00269       if (x == ',')
00270         {
00271           strcat (end_current_string, "\\c");
00272           end_current_string += 2;
00273           length_current_string += 2;
00274         }
00275       else if (x == '\\')
00276         {
00277           strcat (end_current_string, "\\\\");
00278           end_current_string += 2;
00279           length_current_string += 2;
00280         }
00281       else if (x == '\n')
00282         {
00283           strcat (end_current_string, "\\n");
00284           end_current_string += 2;
00285           length_current_string += 2;
00286         }
00287       else if (x == 0 && updating_string)
00288         {
00289         }
00290       else if (!isgraph (x))
00291         {
00292           sprintf (end_current_string, "\\%3.3d", x);
00293           end_current_string += 4;
00294           length_current_string += 4;
00295         }
00296       else
00297         {
00298           end_current_string[0] = x;
00299           end_current_string++;
00300           length_current_string++;
00301         }
00302     }
00303   else
00304     {
00305       if (end_current_string[0] == ',' || end_current_string[0] == 0)
00306         {
00307           x = 0;
00308         }
00309       else if (end_current_string[0] == '\\')
00310         {
00311           if (end_current_string[1] == 'c')
00312             {
00313               x = ',';
00314               end_current_string += 2;
00315               length_current_string += 2;
00316             }
00317           else if (end_current_string[1] == '\\')
00318             {
00319               x = end_current_string[1];
00320               length_current_string += 2;
00321               end_current_string += 2;
00322             }
00323           else if (end_current_string[1] == 'n')
00324             {
00325               x = '\n';
00326               length_current_string += 2;
00327               end_current_string += 2;
00328             }
00329           else
00330             {
00331               char temp[4];
00332               memcpy (temp, end_current_string + 1, 3);
00333               temp[3] = 0;
00334               x = (char) strtol (temp, (char **) NULL, 10);
00335               length_current_string += 4;
00336               end_current_string += 4;
00337             }
00338         }
00339       else
00340         {
00341           x = end_current_string[0];
00342           end_current_string += 1;
00343           length_current_string++;
00344         }
00345     }
00346   return status;
00347 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update char &    x [virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 350 of file cms_dup.cc.

Referenced by update().

00351 {
00352   /* Check to see if the pointers are in the proper range. */
00353   if (-1 == check_pointer ((char RCS_HUGE *) &x, sizeof (char)))
00354     {
00355       return (CMS_UPDATE_ERROR);
00356     }
00357 
00358   update_char (x);
00359   end_current_string[0] = ',';
00360   find_next_comma ();
00361   return (status);
00362 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update unsigned char &    x [virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 392 of file cms_dup.cc.

00393 {
00394   /* Check to see if the pointers are in the proper range. */
00395   if (-1 == check_pointer ((char RCS_HUGE *) &x, sizeof (unsigned char)))
00396     {
00397       return (CMS_UPDATE_ERROR);
00398     }
00399   char cx;
00400   cx = (char) x;
00401   update_char (cx);
00402   x = (unsigned char) x;
00403   end_current_string[0] = ',';
00404   find_next_comma ();
00405 
00406   return (status);
00407 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update short int &    x [virtual]
 

Reimplemented from CMS_UPDATER.

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update unsigned short int &    x [virtual]
 

Reimplemented from CMS_UPDATER.

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update int &    x [virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 559 of file cms_dup.cc.

00560 {
00561   /* Check to see if the pointers are in the proper range. */
00562   if (-1 == check_pointer ((char RCS_HUGE *) &x, sizeof (int)))
00563     {
00564       return (CMS_UPDATE_ERROR);
00565     }
00566 
00567   if (encoding)
00568     {
00569       if (x > 9999999 && warning_count < warning_count_max)
00570         {
00571           warning_count++;
00572           rcs_print_error
00573             ("CMS_DISPLAY_ASCII_UPDATER: int %d is too large. (Use type long.)\n",
00574              x);
00575         }
00576       sprintf (end_current_string, "%+6d,", x);
00577     }
00578   else
00579     {
00580       if (0 == end_current_string[0])
00581         {
00582           x = 0;
00583           return status;
00584         }
00585       errno = 0;
00586       long number = strtol (end_current_string, (char **) NULL, 10);
00587       if (errno != 0)
00588         {
00589           rcs_print_error
00590             ("CMS_DISPLAY_ASCII_UPDATER: Error %ld:%s occured during strtol of (%s).\n",
00591              errno, strerror (errno), end_current_string);
00592           return (status = CMS_UPDATE_ERROR);
00593         }
00594       if ((number < ((long) INT_MIN)) || (((long) INT_MAX) < number)
00595           && warning_count < warning_count_max)
00596         {
00597           warning_count++;
00598           rcs_print_error
00599             ("CMS_DISPLAY_ASCII_UPDATER: (warning) Number %ld out of range for int(%ld,%ld)\n",
00600              number, INT_MIN, INT_MAX);
00601         }
00602       x = (int) number;
00603     }
00604   find_next_comma ();
00605 
00606   return (status);
00607 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update unsigned int &    x [virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 629 of file cms_dup.cc.

00630 {
00631   /* Check to see if the pointers are in the proper range. */
00632   if (-1 == check_pointer ((char RCS_HUGE *) &x, sizeof (unsigned int)))
00633     {
00634       return (CMS_UPDATE_ERROR);
00635     }
00636 
00637   if (encoding)
00638     {
00639       if (x > 9999999 && warning_count < warning_count_max)
00640         {
00641           warning_count++;
00642           rcs_print_error
00643             ("CMS_DISPLAY_ASCII_UPDATER: unsigned int %d is too large. (Use type long.)\n",
00644              x);
00645         }
00646       sprintf (end_current_string, "%6d,", x);
00647     }
00648   else
00649     {
00650       if (0 == end_current_string[0])
00651         {
00652           x = 0;
00653           return status;
00654         }
00655       errno = 0;
00656       unsigned long number = strtoul (end_current_string, (char **) NULL, 10);
00657       if (errno != 0)
00658         {
00659           rcs_print_error
00660             ("CMS_DISPLAY_ASCII_UPDATER: Error %ld:%s occured during strtoul of (%s).\n",
00661              errno, strerror (errno), end_current_string);
00662           return (status = CMS_UPDATE_ERROR);
00663         }
00664       if (UINT_MAX < number && warning_count < warning_count_max)
00665         {
00666           rcs_print_error
00667             ("CMS_DISPLAY_ASCII_UPDATER: Number %d out of range for unsigned int (0,%d)\n",
00668              number, UINT_MAX);
00669         }
00670       x = (unsigned int) number;
00671     }
00672   find_next_comma ();
00673 
00674 
00675   return (status);
00676 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update long int &    x [virtual]
 

Reimplemented from CMS_UPDATER.

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update unsigned long int &    x [virtual]
 

Reimplemented from CMS_UPDATER.

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update float &    x [virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 822 of file cms_dup.cc.

00823 {
00824   /* Check to see if the pointers are in the proper range. */
00825   if (-1 == check_pointer ((char RCS_HUGE *) &x, sizeof (float)))
00826     {
00827       return (CMS_UPDATE_ERROR);
00828     }
00829 
00830   if (encoding)
00831     {
00832       sprintf (end_current_string, "%f,", x);
00833     }
00834   else
00835     {
00836       if (0 == end_current_string[0])
00837         {
00838           x = 0;
00839           return status;
00840         }
00841       errno = 0;
00842       double number = strtod (end_current_string, (char **) NULL);
00843       if (errno != 0)
00844         {
00845           rcs_print_error
00846             ("CMS_DISPLAY_ASCII_UPDATER: Error %ld: %s occured during strtol of (%s).\n",
00847              errno, strerror (errno), end_current_string);
00848           return (status = CMS_UPDATE_ERROR);
00849         }
00850       if ((number < -FLT_MAX || FLT_MAX < number) &&
00851           warning_count < warning_count_max)
00852         {
00853           warning_count++;
00854           rcs_print_error
00855             ("CMS_DISPLAY_ASCII_UPDATER: (warning) Number %lf out of range for float(%f,%f)\n",
00856              number, -FLT_MAX, FLT_MAX);
00857         }
00858       x = (float) number;
00859     }
00860   find_next_comma ();
00861 
00862   return (status);
00863 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update double &    x [virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 887 of file cms_dup.cc.

00888 {
00889   /* Check to see if the pointers are in the proper range. */
00890   if (-1 == check_pointer ((char RCS_HUGE *) &x, sizeof (double)))
00891     {
00892       return (CMS_UPDATE_ERROR);
00893     }
00894 
00895   if (encoding)
00896     {
00897       sprintf (end_current_string, "%f,", x);
00898     }
00899   else
00900     {
00901       if (0 == end_current_string[0])
00902         {
00903           x = 0;
00904           return status;
00905         }
00906       errno = 0;
00907       double number = strtod (end_current_string, (char **) NULL);
00908       if (errno != 0)
00909         {
00910           rcs_print_error
00911             ("CMS_DISPLAY_ASCII_UPDATER: Error %ld: %s occured during strtol of (%s).\n",
00912              errno, strerror (errno), end_current_string);
00913           return (status = CMS_UPDATE_ERROR);
00914         }
00915       x = number;
00916     }
00917   find_next_comma ();
00918 
00919 
00920   return (status);
00921 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update long double &    x [virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 945 of file cms_dup.cc.

00946 {
00947   /* Check to see if the pointers are in the proper range. */
00948   if (-1 == check_pointer ((char RCS_HUGE *) &x, sizeof (long double)))
00949     {
00950       return (CMS_UPDATE_ERROR);
00951     }
00952 
00953   if (encoding)
00954     {
00955       end_current_string[15] = 0;
00956       sprintf (end_current_string, "%-14.8e,", (double) x);
00957     }
00958   else
00959     {
00960       if (0 == end_current_string[0])
00961         {
00962           x = 0;
00963           return status;
00964         }
00965       errno = 0;
00966       double number = strtod (end_current_string, (char **) NULL);
00967       if (errno != 0)
00968         {
00969           rcs_print_error
00970             ("CMS_DISPLAY_ASCII_UPDATER: Error %ld: %s occured during strtod of (%s).\n",
00971              errno, strerror (errno), end_current_string);
00972           return (status = CMS_UPDATE_ERROR);
00973         }
00974       x = (long double) number;
00975     }
00976   find_next_comma ();
00977 
00978   return (status);
00979 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update char *    x,
unsigned int    len
[virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 365 of file cms_dup.cc.

00366 {
00367   /* Check to see if the pointers are in the proper range. */
00368   if (-1 == check_pointer ((char RCS_HUGE *) x, sizeof (char) * len))
00369     {
00370       return (CMS_UPDATE_ERROR);
00371     }
00372   unsigned int i;
00373   updating_string = 1;
00374 
00375   for (i = 0; i < len; i++)
00376     {
00377       update_char (x[i]);
00378       if (x[i] == 0)
00379         {
00380           break;
00381         }
00382     }
00383   end_current_string[0] = ',';
00384   find_next_comma ();
00385   updating_string = 0;
00386   return (status);
00387 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update unsigned char *    x,
unsigned int    len
[virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 410 of file cms_dup.cc.

00411 {
00412   /* Check to see if the pointers are in the proper range. */
00413   if (-1 == check_pointer ((char RCS_HUGE *) x, sizeof (unsigned char) * len))
00414     {
00415       return (CMS_UPDATE_ERROR);
00416     }
00417   char cx;
00418   unsigned int i;
00419 
00420   for (i = 0; i < len; i++)
00421     {
00422       cx = (char) x[i];
00423       update_char (cx);
00424       x[i] = (unsigned char) cx;
00425     }
00426   end_current_string[0] = ',';
00427   find_next_comma ();
00428   return (status);
00429 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update short *    x,
unsigned int    len
[virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 473 of file cms_dup.cc.

00474 {
00475   /* Check to see if the pointers are in the proper range. */
00476   if (-1 == check_pointer ((char RCS_HUGE *) x, sizeof (short) * len))
00477     {
00478       return (CMS_UPDATE_ERROR);
00479     }
00480 
00481   for (unsigned int i = 0; i < len; i++)
00482     {
00483       if (CMS_UPDATE_ERROR == update (x[i]))
00484         {
00485           return (CMS_UPDATE_ERROR);
00486         }
00487     }
00488   return (status);
00489 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update unsigned short *    x,
unsigned int    len
[virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 537 of file cms_dup.cc.

00538 {
00539   /* Check to see if the pointers are in the proper range. */
00540   if (-1 ==
00541       check_pointer ((char RCS_HUGE *) x, sizeof (unsigned short) * len))
00542     {
00543       return (CMS_UPDATE_ERROR);
00544     }
00545 
00546   for (unsigned int i = 0; i < len; i++)
00547     {
00548       if (CMS_UPDATE_ERROR == update (x[i]))
00549         {
00550           return (CMS_UPDATE_ERROR);
00551         }
00552     }
00553   return (status);
00554 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update int *    x,
unsigned int    len
[virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 610 of file cms_dup.cc.

00611 {
00612   /* Check to see if the pointers are in the proper range. */
00613   if (-1 == check_pointer ((char RCS_HUGE *) x, sizeof (int) * len))
00614     {
00615       return (CMS_UPDATE_ERROR);
00616     }
00617 
00618   for (unsigned int i = 0; i < len; i++)
00619     {
00620       if (CMS_UPDATE_ERROR == update (x[i]))
00621         {
00622           return (CMS_UPDATE_ERROR);
00623         }
00624     }
00625   return (status);
00626 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update unsigned int *    x,
unsigned int    len
[virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 679 of file cms_dup.cc.

00680 {
00681   /* Check to see if the pointers are in the proper range. */
00682   if (-1 == check_pointer ((char RCS_HUGE *) x, sizeof (unsigned int) * len))
00683     {
00684       return (CMS_UPDATE_ERROR);
00685     }
00686 
00687   for (unsigned int i = 0; i < len; i++)
00688     {
00689       if (CMS_UPDATE_ERROR == update (x[i]))
00690         {
00691           return (CMS_UPDATE_ERROR);
00692         }
00693     }
00694   return (status);
00695 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update long *    x,
unsigned int    len
[virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 745 of file cms_dup.cc.

00746 {
00747   /* Check to see if the pointers are in the proper range. */
00748   if (-1 == check_pointer ((char RCS_HUGE *) x, sizeof (long) * len))
00749     {
00750       return (CMS_UPDATE_ERROR);
00751     }
00752 
00753   for (unsigned int i = 0; i < len; i++)
00754     {
00755       if (CMS_UPDATE_ERROR == update (x[i]))
00756         {
00757           return (CMS_UPDATE_ERROR);
00758         }
00759     }
00760   return (status);
00761 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update unsigned long *    x,
unsigned int    len
[virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 801 of file cms_dup.cc.

00802 {
00803   /* Check to see if the pointers are in the proper range. */
00804   if (-1 == check_pointer ((char RCS_HUGE *) x, sizeof (unsigned long) * len))
00805     {
00806       return (CMS_UPDATE_ERROR);
00807     }
00808 
00809   for (unsigned int i = 0; i < len; i++)
00810     {
00811       if (CMS_UPDATE_ERROR == update (x[i]))
00812         {
00813           return (CMS_UPDATE_ERROR);
00814         }
00815     }
00816   return (status);
00817 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update float *    x,
unsigned int    len
[virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 866 of file cms_dup.cc.

00867 {
00868   /* Check to see if the pointers are in the proper range. */
00869   if (-1 == check_pointer ((char RCS_HUGE *) x, sizeof (float) * len))
00870     {
00871       return (CMS_UPDATE_ERROR);
00872     }
00873 
00874   for (unsigned int i = 0; i < len; i++)
00875     {
00876       if (CMS_UPDATE_ERROR == update (x[i]))
00877         {
00878           return (CMS_UPDATE_ERROR);
00879         }
00880     }
00881   return (status);
00882 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update double *    x,
unsigned int    len
[virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 924 of file cms_dup.cc.

00925 {
00926   /* Check to see if the pointers are in the proper range. */
00927   if (-1 == check_pointer ((char RCS_HUGE *) x, sizeof (double) * len))
00928     {
00929       return (CMS_UPDATE_ERROR);
00930     }
00931 
00932   for (unsigned int i = 0; i < len; i++)
00933     {
00934       if (CMS_UPDATE_ERROR == update (x[i]))
00935         {
00936           return (CMS_UPDATE_ERROR);
00937         }
00938     }
00939   return (status);
00940 }

CMS_STATUS CMS_DISPLAY_ASCII_UPDATER::update long double *    x,
unsigned int    len
[virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 982 of file cms_dup.cc.

00983 {
00984   /* Check to see if the pointers are in the proper range. */
00985   if (-1 == check_pointer ((char RCS_HUGE *) x, sizeof (long double) * len))
00986     {
00987       return (CMS_UPDATE_ERROR);
00988     }
00989 
00990   for (unsigned int i = 0; i < len; i++)
00991     {
00992       if (CMS_UPDATE_ERROR == update (x[i]))
00993         {
00994           return (CMS_UPDATE_ERROR);
00995         }
00996     }
00997   return (status);
00998 }

int CMS_DISPLAY_ASCII_UPDATER::set_mode CMS_UPDATER_MODE    _mode [virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 143 of file cms_dup.cc.

00144 {
00145   mode = _mode;
00146   CMS_UPDATER::set_mode (_mode);
00147   switch (mode)
00148     {
00149     case CMS_NO_UPDATE:
00150       begin_current_string = end_current_string = (char *) NULL;
00151       max_length_current_string = 0;
00152       length_current_string = 0;
00153       break;
00154 
00155     case CMS_ENCODE_DATA:
00156       begin_current_string = end_current_string = (char *) encoded_data;
00157       max_length_current_string = neutral_size_factor * size;
00158       if (max_length_current_string > cms_parent->max_encoded_message_size)
00159         {
00160           max_length_current_string = cms_parent->max_encoded_message_size;
00161         }
00162       length_current_string = 0;
00163       encoding = 1;
00164       break;
00165 
00166     case CMS_DECODE_DATA:
00167       begin_current_string = end_current_string = (char *) encoded_data;
00168       max_length_current_string = neutral_size_factor * size;
00169       if (max_length_current_string > cms_parent->max_encoded_message_size)
00170         {
00171           max_length_current_string = cms_parent->max_encoded_message_size;
00172         }
00173       length_current_string = 0;
00174       encoding = 0;
00175       break;
00176 
00177     case CMS_ENCODE_HEADER:
00178       begin_current_string = end_current_string = (char *) encoded_header;
00179       max_length_current_string = neutral_size_factor * sizeof (CMS_HEADER);
00180       length_current_string = 0;
00181       encoding = 1;
00182       break;
00183 
00184     case CMS_DECODE_HEADER:
00185       begin_current_string = end_current_string = (char *) encoded_header;
00186       max_length_current_string = neutral_size_factor * sizeof (CMS_HEADER);
00187       length_current_string = 0;
00188       encoding = 0;
00189       break;
00190 
00191     case CMS_ENCODE_QUEUING_HEADER:
00192       begin_current_string = end_current_string =
00193         (char *) encoded_queuing_header;
00194       max_length_current_string =
00195         neutral_size_factor * sizeof (CMS_QUEUING_HEADER);
00196       length_current_string = 0;
00197       encoding = 1;
00198       break;
00199 
00200     case CMS_DECODE_QUEUING_HEADER:
00201       begin_current_string = end_current_string =
00202         (char *) encoded_queuing_header;
00203       max_length_current_string =
00204         neutral_size_factor * sizeof (CMS_QUEUING_HEADER);
00205       length_current_string = 0;
00206       encoding = 0;
00207       break;
00208 
00209     default:
00210       rcs_print_error ("CMS updater in invalid mode.\n");
00211       return (-1);
00212     }
00213   return (0);
00214 }

void CMS_DISPLAY_ASCII_UPDATER::rewind   [virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 239 of file cms_dup.cc.

00240 {
00241   CMS_UPDATER::rewind ();
00242   end_current_string = begin_current_string;
00243   if (encoding)
00244     {
00245       memset (begin_current_string, 0, max_length_current_string);
00246     }
00247   length_current_string = 0;
00248   if (NULL != cms_parent)
00249     {
00250       cms_parent->format_size = 0;
00251     }
00252 }

int CMS_DISPLAY_ASCII_UPDATER::get_encoded_msg_size   [virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 256 of file cms_dup.cc.

00257 {
00258   return (length_current_string);
00259 }

int CMS_DISPLAY_ASCII_UPDATER::check_pointer char RCS_HUGE *    _pointer,
long    _bytes
[protected, virtual]
 

Reimplemented from CMS_UPDATER.

Definition at line 217 of file cms_dup.cc.

Referenced by update().

00219 {
00220   if (NULL == cms_parent || NULL == begin_current_string
00221       || NULL == end_current_string)
00222     {
00223       rcs_print_error
00224         ("CMS_DISPLAY_ASCII_UPDATER: Required pointer is NULL.\n");
00225       return (-1);
00226     }
00227   if (length_current_string + _bytes * 4 > max_length_current_string)
00228     {
00229       rcs_print_error
00230         ("CMS_DISPLAY_ASCII_UPDATER: length of current string(%ld) + bytes to add of(%d) exceeds maximum of %ld.\n",
00231          length_current_string, _bytes * 4, max_length_current_string);
00232       return (-1);
00233     }
00234   return (cms_parent->check_pointer (_pointer, _bytes));
00235 }


Friends And Related Function Documentation

friend class RCS_EXPORT CMS [friend]
 

Reimplemented from CMS_UPDATER.

Definition at line 43 of file cms_dup.hh.


Field Documentation

char* CMS_DISPLAY_ASCII_UPDATER::begin_current_string [protected]
 

Definition at line 44 of file cms_dup.hh.

char* CMS_DISPLAY_ASCII_UPDATER::end_current_string [protected]
 

Definition at line 45 of file cms_dup.hh.

long CMS_DISPLAY_ASCII_UPDATER::max_length_current_string [protected]
 

Definition at line 46 of file cms_dup.hh.

long CMS_DISPLAY_ASCII_UPDATER::length_current_string [protected]
 

Definition at line 47 of file cms_dup.hh.

int CMS_DISPLAY_ASCII_UPDATER::encoding [protected]
 

Reimplemented from CMS_UPDATER.

Definition at line 48 of file cms_dup.hh.

int CMS_DISPLAY_ASCII_UPDATER::warning_count [protected]
 

Definition at line 49 of file cms_dup.hh.

int CMS_DISPLAY_ASCII_UPDATER::warning_count_max [protected]
 

Definition at line 50 of file cms_dup.hh.

int CMS_DISPLAY_ASCII_UPDATER::updating_string [protected]
 

Definition at line 51 of file cms_dup.hh.


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