UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
pep.H
1 /* pep.H */
2 /* $Id: pep.H,v 1.5 2009/04/14 12:05:40 vlad Exp $ */
3 #ifndef __pep_H
4 #define __pep_H
5 
6 #include <mix/IntAr.H>
7 #include <csi/param.H>
8 #include <csi/pep_defs.h>
9 
10 
11 /*************************************************************
12  *
13  * Parameters Exchange Protocol Controls
14  *
15  *************************************************************/
16 
17 #define PEP_CORE
18 
23 class Protocol
24 {
25 private:
26 
27  TableUDC *shvt;
28  TableUDC *lovt;
29  LockBlock *sem;
31  ParDescAr pdar;
33  char pep_name[PEP_MAX_NAME_LEN+1];
34  char pep_app[PEP_MAX_NAME_LEN+1];
37  pepAccess mode;
38 
40  void read_defaults (FILE* fp);
41 
42 public:
43 
45  Protocol (const char *app, const char *name, pepAccess amode);
46 
48  virtual ~Protocol ();
49 
51  void input_table (FILE* stream);
52 
54  void input_table (const char* filename);
55 
56  /* Text output to stream */
57  void output_table (FILE* stream);
58 
59  /* Text output to file */
60  void output_table (const char* filename);
61 
63  Logic news (const char* pname);
64 
67  void publish_table ();
68 
72  void absorb_table (IntAr* news = NULL);
73 
75  void publish (const char* pname);
76 
79  Logic absorb (const char* pname);
80 
81  /* parameter values' access */
82 
84  void text_input (const char* pname, FILE* stream);
85 
87  void text_output (const char* pname, FILE* stream);
88 
90  void init (const char* pname);
91 
93  size_t size (const char* pname);
94 
96  void set_text (const char* pname, const char* textvalue);
97  void set_value (const char* pname, ...);
98  void set_va_lue (const char* pname, va_list val)
99  {register int i = n2i(pname);
100  pdar[i].ptype->set_value((*lovt)[i], val);}
101 
103  void get_text (const char* pname, char*& textvalue);
104  void get_value (const char* pname, ...);
105  void get_va_lue (const char* pname, va_list val)
106  {register int i = n2i(pname);
107  pdar[i].ptype->get_value((*lovt)[i], val);}
108 
110  ParDesc& desc (const char* pname);
111 
113  ParDesc& desc (int i)
114  {return pdar[i];}
115 
117  int n2i (const char* pname);
118 
120  const char* i2n (int i);
121 
123  int param_count () const
124  { return pdar.count(); }
125 
127  const char* protocol () const
128  { return pep_name; }
129 
131  const char* application () const
132  { return pep_app; }
133 
134 };
135 
136 
137 #endif /* pep.H */
Logic absorb(const char *pname)
int param_count() const
Definition: pep.H:123
const char * i2n(int i)
void init(const char *pname)
int n2i(const char *pname)
const char * application() const
Definition: pep.H:131
virtual ~Protocol()
void text_output(const char *pname, FILE *stream)
void absorb_table(IntAr *news=NULL)
size_t size(const char *pname)
Definition: IntAr.H:14
Definition: pep_ipc.H:54
void get_text(const char *pname, char *&textvalue)
void set_text(const char *pname, const char *textvalue)
Definition: param.H:57
Logic news(const char *pname)
void publish(const char *pname)
ParDesc & desc(const char *pname)
Protocol(const char *app, const char *name, pepAccess amode)
Definition: pep.H:23
ParDesc & desc(int i)
Definition: pep.H:113
const char * protocol() const
Definition: pep.H:127
void input_table(FILE *stream)
Definition: memctl.H:198
void text_input(const char *pname, FILE *stream)
void publish_table()