COVISE Core
covise_appproc.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef COVISE_APPPROC_H
9 #define COVISE_APPPROC_H
10 
11 #include "covise_process.h"
12 #include "covise.h"
13 
14 class ShmAccess;
15 
16 namespace covise
17 {
18 
20 {
21 //friend class DO_PartitionedObject;
22 #ifdef CRAY
23  DataManagerProcess *datamgr;
24 #endif
26  ShmAccess *shm; // pointer to the sharedmemory
27  //List<coDistributedObject> *part_obj_list;
28 protected:
29  void process_msg_from_dmgr(Message *); // handle msg from datamgr
30  int id;
31  int instance;
32 
33 public:
35  ApplicationProcess(const char *name, int id);
36  ApplicationProcess(const char *n, int arc, char *arv[],
37  sender_type send_type = APPLICATIONMODULE);
38  ~ApplicationProcess(); // destructor
39  void handle_shm_msg(Message *);
40  void contact_controller(int port, Host *host);
41  void contact_datamanager(int port); // build connection to datamanager
42  void send_data_msg(Message *); // send message to the datamanager
43  void recv_data_msg(Message *); // recv a message from the datamanager
44  void exch_data_msg(Message *, const std::vector<int> &messageTypes); //send msg and wait for a response with one of messageTypes
45  //void add_new_part_obj(coDistributedObject *po) { part_obj_list->add(po); };
46  // gets part obj out of list
47  //coDistributedObject *get_part_obj(char *pname);
48  Message *wait_for_ctl_msg(); // wait for a message from the controller
49  Message *wait_for_data_msg(); // wait for a message from the datamanager
50  Message *check_for_ctl_msg(float time = 0.0);
51  int check_msg_queue(); // returns true if message is available in queue
52  // wait for a message from the controller at most time seconds
53  void *get_shared_memory_address();
55  {
56  return (instance);
57  };
58  int get_id()
59  {
60  return (id);
61  };
62  // nur temporaer eingefuegt, zum testen !! ^
63 };
64 
65 // process for the userinterface
67 {
68 public:
69  // UserInterface(char *name, int id) :
70  // ApplicationProcess(name, id, USERINTERFACE) {};
71  UserInterface(const char *n, int arc, char *arv[])
72  : ApplicationProcess(n, arc, arv, USERINTERFACE){};
73  ~UserInterface() // destructor
74  {};
75  void contact_controller(int, Host *);
76 };
77 }
78 #endif
Definition: covise_shm.h:311
UserInterface(const char *n, int arc, char *arv[])
Definition: covise_appproc.h:71
Definition: covise_appproc.h:19
int instance
Definition: covise_appproc.h:31
int get_id()
Definition: covise_appproc.h:58
Definition: covise_process.h:170
ShmAccess * shm
Definition: covise_appproc.h:26
~UserInterface()
Definition: covise_appproc.h:73
int id
Definition: covise_appproc.h:30
int get_instance()
Definition: covise_appproc.h:54
sender_type
Definition: message_types.h:368
static ApplicationProcess * approc
Definition: covise_appproc.h:34
GLdouble n
Definition: khronos-glext.h:8447
const DataManagerConnection * datamanager
Definition: covise_appproc.h:25
Definition: covise_appproc.h:66
Definition: message_types.h:375
#define COVISEEXPORT
Definition: coExport.h:200
Definition: dmgr.h:215
Definition: message_types.h:373
Definition: covise_host.h:18
Definition: covise_connect.h:293
list of all chemical elements
Definition: coConfig.h:26
Definition: message.h:75
GLuint const GLchar * name
Definition: khronos-glext.h:6722