Nls

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
nls -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 <upsnls.hh>
#include <upscrbexception.h>

using namespace std;

static const CORBA::UShort CO_SectionDivers=1;
static const CORBA::UShort CO_SectionLibelleMessage=2;
static const CORBA::UShort CO_SectionLibelleParametre=3;
static const CORBA::UShort CO_SectionLibelleInstruction=4;
static const CORBA::UShort CO_SectionAide=5;
static const CORBA::UShort CO_SectionLibelleRegle=6;

static const CORBA::UShort CO_PaysAllemagne=1;
static const CORBA::UShort CO_PaysAngleterre=2;
static const CORBA::UShort CO_PaysChine=3;
static const CORBA::UShort CO_PaysCoreeSud=4;
static const CORBA::UShort CO_PaysDanemark=5;
static const CORBA::UShort CO_PaysEspagne=6;
static const CORBA::UShort CO_PaysEtatsUnis=7;
static const CORBA::UShort CO_PaysFinlande=8;
static const CORBA::UShort CO_PaysFrance=9;
static const CORBA::UShort CO_PaysGrece=10;
static const CORBA::UShort CO_PaysHollande=11;
static const CORBA::UShort CO_PaysIsrael=12;
static const CORBA::UShort CO_PaysItalie=13;
static const CORBA::UShort CO_PaysJapon=14;
static const CORBA::UShort CO_PaysNorvege=15;
static const CORBA::UShort CO_PaysPologne=16;
static const CORBA::UShort CO_PaysPortugal=17;
static const CORBA::UShort CO_PaysRussie=18;
static const CORBA::UShort CO_PaysSuede=19;
static const CORBA::UShort CO_PaysSuisse=20;

static const CORBA::UShort CO_PageUs7Ascii=1;
static const CORBA::UShort CO_PageWE8Iso8859P1=2;
static const CORBA::UShort CO_PageEE8Iso8859P2=3;
static const CORBA::UShort CO_PageWE8Iso8859P9=4;
static const CORBA::UShort CO_PageNE8Iso8859P10=5;
static const CORBA::UShort CO_PageUs8Pc437=6;
static const CORBA::UShort CO_PageWE8Pc850=7;
static const CORBA::UShort CO_PageUS8Pc852=8;
static const CORBA::UShort CO_PageWE8Pc857=9;
static const CORBA::UShort CO_PageWE8MacRoman8=10;
static const CORBA::UShort CO_PageWE8Windows1=11;
static const CORBA::UShort CO_PageEE8Windows2=12;
static const CORBA::UShort CO_PageWE8Ebcdic297=13;
static const CORBA::UShort CO_PageWE8Ebcdic500=14;
static const CORBA::UShort CO_PageWE8Ebcdic037=15;
static const CORBA::UShort CO_PageWE8Ebcdic260=16;

static const CORBA::UShort CO_FuseauEniwetokKwajalein=1;
static const CORBA::UShort CO_FuseauMidwaySamoa=2;
static const CORBA::UShort CO_FuseauHawai=3;
static const CORBA::UShort CO_FuseauAlaska=4;
static const CORBA::UShort CO_FuseauTijuana=5;
static const CORBA::UShort CO_FuseauArizona=6;
static const CORBA::UShort CO_FuseauRocheuseAmerique=7;
static const CORBA::UShort CO_FuseauCentreAmerique=8;
static const CORBA::UShort CO_FuseauMexicoTegucigalpa=9;
static const CORBA::UShort CO_FuseauSaskatchevan=10;
static const CORBA::UShort CO_FuseauBogotaLimaQuito=11;
static const CORBA::UShort CO_FuseauEstAmerique=12;
static const CORBA::UShort CO_FuseauIndiana=13;
static const CORBA::UShort CO_FuseauAtlantique=14;
static const CORBA::UShort CO_FuseauCaracasLaPaz=15;
static const CORBA::UShort CO_FuseauTerreNeuve=16;
static const CORBA::UShort CO_FuseauBresil=17;
static const CORBA::UShort CO_FuseauBuenosAiresGeorgeTown=18;
static const CORBA::UShort CO_FuseauMilieuAtlantique=19;
static const CORBA::UShort CO_FuseauAcoresCapVert=20;
static const CORBA::UShort CO_FuseauCasablancaMonrovia=21;
static const CORBA::UShort CO_FuseauGreenwich=22;
static const CORBA::UShort CO_FuseauAmsterdamBerlinBernRome=23;
static const CORBA::UShort CO_FuseauBelgradeBudapestPrague=24;
static const CORBA::UShort CO_FuseauBruxellesMadridParis=25;
static const CORBA::UShort CO_FuseauSarajevoSofiaVarsovie=26;
static const CORBA::UShort CO_FuseauAthenesIstanbulMinsk=27;
static const CORBA::UShort CO_FuseauBucarest=28;
static const CORBA::UShort CO_FuseauCaire=29;
static const CORBA::UShort CO_FuseauPretoria=30;
static const CORBA::UShort CO_FuseauHelsinkiRigaTallinn=31;
static const CORBA::UShort CO_FuseauIsrael=32;
static const CORBA::UShort CO_FuseauBagdhadKoweitRiyadh=33;
static const CORBA::UShort CO_FuseauMoscouStPetersbourg=34;
static const CORBA::UShort CO_FuseauNairobi=35;
static const CORBA::UShort CO_FuseauTeheran=36;
static const CORBA::UShort CO_FuseauAbuDhabiMuscat=37;
static const CORBA::UShort CO_FuseauBakouTbilisi=38;
static const CORBA::UShort CO_FuseauKabul=39;
static const CORBA::UShort CO_FuseauEkaterinburg=40;
static const CORBA::UShort CO_FuseauIsmalabadKarachiTaschkent=41;
static const CORBA::UShort CO_FuseauBombayCalcuttaNewDelhi=42;
static const CORBA::UShort CO_FuseauAlmatyDhaka=43;
static const CORBA::UShort CO_FuseauColombo=44;
static const CORBA::UShort CO_FuseauBangkokHanoiJakarta=45;
static const CORBA::UShort CO_FuseauPekinHongKongUrumqi=46;
static const CORBA::UShort CO_FuseauPerth=47;
static const CORBA::UShort CO_FuseauSingapour=48;
static const CORBA::UShort CO_FuseauCeylan=49;
static const CORBA::UShort CO_FuseauOsakaSapporoTokyo=50;
static const CORBA::UShort CO_FuseauSeoul=51;
static const CORBA::UShort CO_FuseauYakutsk=52;
static const CORBA::UShort CO_FuseauAdelaide=53;
static const CORBA::UShort CO_FuseauDarwin=54;
static const CORBA::UShort CO_FuseauBrisbane=55;
static const CORBA::UShort CO_FuseauCanberraMelbourneSydney=56;
static const CORBA::UShort CO_FuseauGuamPortMoresby=57;
static const CORBA::UShort CO_FuseauHobart=58;
static const CORBA::UShort CO_FuseauVladivostok=59;
static const CORBA::UShort CO_FuseauMagadanSalomonNouvelleCaledonie=60;
static const CORBA::UShort CO_FuseauAucklandWellington=61;
static const CORBA::UShort CO_FuseauFijiKamchatkaMarshall=62;

static const CORBA::UShort CO_MetriqueMetre=1;
static const CORBA::UShort CO_MetriqueYard=2;

static const CORBA::UShort CO_SousMetriqueCentiMetre=1;
static const CORBA::UShort CO_SousMetriquePouce=2;
static const CORBA::UShort CO_SousMetriquePied=3;

static const CORBA::UShort CO_SubMetriqueKiloMetre=1;
static const CORBA::UShort CO_SubMetriqueMilleTerrestre=2;
static const CORBA::UShort CO_SubMetriqueMilleMarin=3;

static const CORBA::UShort CO_PoidsKiloGramme=1;
static const CORBA::UShort CO_PoidsLivre=2;
static const CORBA::UShort CO_PoidsOnce=3;

static const CORBA::UShort CO_TemperatureKelvin=1;
static const CORBA::UShort CO_TemperatureCelsius=2;
static const CORBA::UShort CO_TemperatureFahrenheit=3;

static const CORBA::UShort CO_AngleRadian=1;
static const CORBA::UShort CO_AngleDegres=2;
static const CORBA::UShort CO_AngleGrade=3;

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

/****************************************************************/
int main(int argc, char *argv[])
/****************************************************************/
{
IUpsKrnCaractere_var C;

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) pObjet=pOrb->bind("IDL:IUpsNls:1.0");
if (!pObjet) pIUpsNls=IUpsNls::_narrow(pObjet);
if (!pIUpsNls)
try catch (UpsCrbException *E) catch (CORBA::Exception &e)
C=NULL;
CORBA::release(pIUpsNls);
pIUpsNls=NULL;
CORBA::release(pIUpsSys);
pIUpsSys=NULL;
CORBA::release(pIUpsKrn);
pIUpsKrn=NULL;
delete pBoa;
delete pOrb;
return(0);
}