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

BBDMEM Class Reference

#include <bbdmem.hh>

Inheritance diagram for BBDMEM:

Inheritance graph
[legend]
Collaboration diagram for BBDMEM:

Collaboration graph
[legend]

Public Methods

 BBDMEM (char *bufline, char *procline, int set_to_server=0, int set_to_master=0)
 ~BBDMEM ()
CMS_STATUS read ()
CMS_STATUS peek ()
CMS_STATUS write (void *data)
CMS_STATUS write_if_read (void *data)

Data Fields

BBD reader_bbd_id
BBD writer_bbd_id
void * bbd_data
int bbd_timeout
long bbd_size
int id

Constructor & Destructor Documentation

BBDMEM::BBDMEM char *    _bufline,
char *    _procline,
int    set_to_server = 0,
int    set_to_master = 0
 

Definition at line 139 of file bbdmem.cc.

00141     {
00142       bbdDelete (reader_bbd_id);
00143       reader_bbd_id = NULL;
00144     }
00145   if (NULL != writer_bbd_id)
00146     {
00147       bbdDelete (writer_bbd_id);
00148       writer_bbd_id = NULL;
00149     }
00150   bbd_data = NULL;
00151 }
00152 
00153 CMS_STATUS BBDMEM::read ()
00154 {
00155   if (NULL == bbd_data)
00156     {
00157       bbd_data = (void *) (((char *) data) + sizeof_message_header);
00158     }
00159 
00160   if (!read_permission_flag)
00161     {
00162       rcs_print_error ("Read permission denied.\n");
00163       return (status = CMS_PERMISSIONS_ERROR);
00164     }
00165   if (bbdRead (reader_bbd_id, bbd_data, BBD_FRESH_READ, NO_WAIT) == OK)
00166     {
00167       id++;
00168     }
00169   else
00170     {
00171       //      rcs_print_error("BBD error or no new data.\n");
00172     }
00173 
00174   /*
00175      {
00176      rcs_print_error("BBD ERROR:\n");
00177      bbdShow(reader_bbd_id, BufferName);
00178      return(status = CMS_MISC_ERROR);
00179      }
00180 
00181 
00182      rId = (BBD_READER *) reader_bbd_id;
00183      if(NULL == rId)
00184      {
00185      rcs_print_error("Can't get writeCnt from BBD.\n");
00186      return(status = CMS_MISC_ERROR);
00187      }
00188      wId = rId->bbd;
00189      if(NULL == wId)
00190      {
00191      rcs_print_error("Can't get writeCnt from BBD.\n");
00192      return(status = CMS_MISC_ERROR);
00193      }
00194      id = wId->writeCnt;
00195    */
00196 
00197   check_id (id);
00198   return status;
00199 }
00200 
00201 CMS_STATUS BBDMEM::peek ()
00202 {
00203   if (NULL == bbd_data)
00204     {
00205       bbd_data = (void *) (((char *) data) + sizeof_message_header);
00206     }
00207 
00208   if (!read_permission_flag)
00209     {
00210       rcs_print_error ("Read permission denied.\n");
00211       return (status = CMS_PERMISSIONS_ERROR);
00212     }
00213   if (bbdRead (reader_bbd_id, bbd_data, BBD_FRESH_READ, NO_WAIT) == OK)
00214     {
00215       id++;
00216     }
00217   else
00218     {
00219       // rcs_print_error("BBD error or no new data.\n");
00220     }
00221 
00222   /*   else
00223      {
00224      rcs_print_error("BBD ERROR:\n");
00225      bbdShow(reader_bbd_id, BufferName);
00226      return(status = CMS_MISC_ERROR);
00227      }
00228 
00229      rId = (BBD_READER *) reader_bbd_id;
00230      if(NULL == rId)
00231      {
00232      rcs_print_error("Can't get writeCnt from BBD.\n");
00233      return(status = CMS_MISC_ERROR);
00234      }
00235      wId = rId->bbd;
00236      if(NULL == wId)
00237      {
00238      rcs_print_error("Can't get writeCnt from BBD.\n");

BBDMEM::~BBDMEM  
 

Definition at line 240 of file bbdmem.cc.

00249 {
00250   bbd_data = (void *) (((char *) user_data) + sizeof_message_header);
00251 
00252   if (!write_permission_flag)
00253     {
00254       rcs_print_error ("Write permission denied.\n");
00255       return (status = CMS_PERMISSIONS_ERROR);
00256     }


Member Function Documentation

CMS_STATUS BBDMEM::read   [virtual]
 

Reimplemented from CMS.

Definition at line 258 of file bbdmem.cc.

00258     {
00259       rcs_print_error ("BBD ERROR:\n");
00260       bbdShow (writer_bbd_id, BufferName);
00261       return (status = CMS_MISC_ERROR);
00262     }
00263 
00264   return (status = CMS_WRITE_OK);
00265 }
00266 
00267 CMS_STATUS BBDMEM::write_if_read (void *user_data)
00268 {
00269   bbd_data = (void *) (((char *) user_data) + sizeof_message_header);
00270 
00271   if (!write_permission_flag)
00272     {
00273       rcs_print_error ("Write permission denied.\n");
00274       return (status = CMS_PERMISSIONS_ERROR);
00275     }
00276   if (bbdWrite (writer_bbd_id, bbd_data, BBD_WAIT_WRITE, NO_WAIT) != OK)
00277     {
00278       rcs_print_error ("BBD ERROR:\n");
00279       bbdShow (writer_bbd_id, BufferName);
00280       return (status = CMS_MISC_ERROR);
00281     }
00282 
00283   return (status = CMS_WRITE_OK);
00284 }

CMS_STATUS BBDMEM::peek   [virtual]
 

Reimplemented from CMS.

Definition at line 306 of file bbdmem.cc.

CMS_STATUS BBDMEM::write void *    user_data [virtual]
 

Reimplemented from CMS.

Definition at line 353 of file bbdmem.cc.

CMS_STATUS BBDMEM::write_if_read void *    user_data [virtual]
 

Reimplemented from CMS.

Definition at line 372 of file bbdmem.cc.


Field Documentation

BBD BBDMEM::reader_bbd_id
 

Definition at line 139 of file bbdmem.hh.

BBD BBDMEM::writer_bbd_id
 

Definition at line 140 of file bbdmem.hh.

void* BBDMEM::bbd_data
 

Definition at line 141 of file bbdmem.hh.

int BBDMEM::bbd_timeout
 

Definition at line 142 of file bbdmem.hh.

long BBDMEM::bbd_size
 

Definition at line 143 of file bbdmem.hh.

int BBDMEM::id
 

Definition at line 144 of file bbdmem.hh.


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