Fichier

Commande de compilation

Commande d'enregistrement des objets Corba

${MICO_HOME}/bin/ird -ORBIIOPAddr inet:localhost:8888 --db ${MICO_HOME}/db/db-ird
${MICO_HOME}/bin/micod -ORBIIOPAddr inet:localhost:9999 --db ${MICO_HOME}/db/db-micod.txt --forward
upsvtm Corba=Charger

Commande d'exécution

${MICO_HOME}/bin/ird -ORBIIOPAddr inet:localhost:8888 --db ${MICO_HOME}/db/db-ird
${MICO_HOME}/bin/micod -ORBIIOPAddr inet:localhost:9999 --db ${MICO_HOME}/db/db-micod.txt --forward
fichier -ORBIfaceRepoAddr inet:localhost:8888 -ORBImplRepoAddr inet:localhost:9999 -ORBBindAddr local:

Fichier source

#include <CORBA.h>
#include <mico/string.h>
#include <upskrn.hh>
#include <upssys.hh>
#include <upscrbexception.h>

using namespace std;

static const CORBA::UShort CO_NonOuvert=1;
static const CORBA::UShort CO_LectureTexte=2;
static const CORBA::UShort CO_EcritureTexte=3;
static const CORBA::UShort CO_EcritureTexteALaSuite=4;
static const CORBA::UShort CO_LectureEcritureTexte=5;
static const CORBA::UShort CO_LectureBinaire=6;
static const CORBA::UShort CO_EcritureBinaire=7;
static const CORBA::UShort CO_EcritureBinaireALaSuite=8;
static const CORBA::UShort CO_LectureEcritureBinaire=9;

static const CORBA::UShort CO_MemoireVolatile=1;
static const CORBA::UShort CO_MemoirePersistant=2;
static const CORBA::UShort CO_SynchroneSysteme=3;
static const CORBA::UShort CO_AsynchroneSysteme=4;
static const CORBA::UShort CO_Asynchrone1024=5;
static const CORBA::UShort CO_Asynchrone4096=6;
static const CORBA::UShort CO_Asynchrone16384=7;
static const CORBA::UShort CO_Asynchrone65536=8;

static CORBA::ORB *pOrb;
static CORBA::BOA *pBoa;
static CORBA::Object *pObjet;
static IUpsKrn *pIUpsKrn;
static IUpsSys *pIUpsSys;

/****************************************************************/
int main(int argc, char *argv[])
/****************************************************************/
{
IUpsSysFichier_var F;
IUpsSysFichier_var FBis;
IUpsKrnCaractere_var C;
CORBA::Long E;
CORBA::Double R;
CORBA::Boolean B;
CORBA::Long P;

pOrb=CORBA::ORB_init(argc,argv, "mico-local-orb");
if (!pOrb) pBoa=pOrb->BOA_init(argc, argv, "mico-local-boa");
if (!pBoa) pObjet=pOrb->bind("IDL:IUpsKrn:1.0");
if (!pObjet) pIUpsKrn=IUpsKrn::_narrow(pObjet);
if (!pIUpsKrn) pObjet=pOrb->bind("IDL:IUpsSys:1.0");
if (!pObjet) pIUpsSys=IUpsSys::_narrow(pObjet);
if (!pIUpsSys)
try catch (UpsCrbException *E) catch (CORBA::Exception &e)
B=NULL;
CORBA::release(pIUpsKrn);
pIUpsKrn=NULL;
delete pBoa;
delete pOrb;
return(0);
}