/ src / libnml / buffer / locmem.hh
locmem.hh
 1  /********************************************************************
 2  * Description: locmem.hh
 3  *   Implements LOCMEM which is a derived class of CMS that serves
 4  *   primarily to provide addresses that match when matching buffer
 5  *   names are passed to the constructor. It is useful in allowing
 6  *   control modules to use the same inteface to communicate as would
 7  *   be required if they were not running in the same process even
 8  *   though to use LOCMEM they must be.
 9  *
10  *   Derived from a work by Fred Proctor & Will Shackleford
11  *
12  * Author:
13  * License: LGPL Version 2
14  * System: Linux
15  *    
16  * Copyright (c) 2004 All rights reserved.
17  *
18  * Last change: 
19  ********************************************************************/
20  
21  #ifndef LOCMEM_HH
22  #define LOCMEM_HH
23  
24  #include "cms.hh"		// class CMS
25  #include "linklist.hh"		// class LinkedList
26  
27  struct BUFFERS_LIST_NODE {
28      void *addr;
29      long size;
30      char name[64];
31  };
32  
33  class LOCMEM:public CMS {
34    public:
35      LOCMEM(const char *bufline, const char *procline, int set_to_server =
36  	0, int set_to_master = 0);
37        virtual ~ LOCMEM();
38      CMS_STATUS main_access(void *_local, int *serial_number);
39  
40    protected:
41      void *lm_addr;
42      int buffer_id;
43      BUFFERS_LIST_NODE *my_node;
44      static LinkedList *buffers_list;
45  };
46  
47  #endif