diff options
| author | Manuel Traut <manut@mecka.net> | 2012-06-03 13:53:44 +0200 |
|---|---|---|
| committer | Manuel Traut <manut@mecka.net> | 2012-06-03 13:53:44 +0200 |
| commit | 0f322594c1a54f5058c77173a4eef04f73bc7a29 (patch) | |
| tree | f3f9e90f935455f34fb033d2a454fadbf8a740c0 /common/common.h | |
| parent | 9846551e704f5998cd8f62a95b044e2ae8208579 (diff) | |
libdistrio_common: add corba helper functions
- to initialize orb
- to register new digital objects at the naming service
- to run the orb
Signed-off-by: Manuel Traut <manut@mecka.net>
Diffstat (limited to 'common/common.h')
| -rw-r--r-- | common/common.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/common/common.h b/common/common.h new file mode 100644 index 0000000..8070544 --- /dev/null +++ b/common/common.h @@ -0,0 +1,40 @@ +/** + * CORBA helpers + * + * - init orb + * - get reference to name service + * - register objects @ name service + * + * @author Manuel Traut <manut@mecka.net> + * @licence GPLv2 + */ + +#include <distrio_ioI.h> +#include <distrio_ioC.h> +#include <distrio_ioS.h> + +#include <orbsvcs/CosNamingC.h> + +/** + * handle to corba objects needed for registration of new objects and running + * the ORB + */ +typedef struct _corba_ref { + /** init > 0 if orb is initialized */ + int init; + CORBA::ORB_var orb; + PortableServer::POA_var poa; + PortableServer::POAManager_var poa_mgr; + CosNaming::NamingContext_var nc; +} corba_ref; + +static corba_ref ref = { + .init = 0, +}; + +/** initialize corba orb - argc, argv as passed to main() */ +int init_corba (int argc, char **argv); +/** register a digital io with a common name at the naming service */ +int register_digital (char *_name, Distrio_Digital_i *digital); +/** run the orb - function blocks until orb shutdown */ +int run_orb (void); |
