cmdriver/src/CMDriver.cxx
//---------------------------------------------------------------------------
// Constructs object CmXml, which implements 'CM:Generic' interface.
// This object will reply on all income queries from the clients.
//---------------------------------------------------------------------------
Constructs object CmXml, which implements 'CM:Generic' interface.
This object will reply on all income queries from the clients.
Constructs object CmXml which implements ' CM : Generic ' interface . This object will reply on all income queries from the clients .
static int initCmXml(const char *xml_file) {
    char filePath[1024];
    if(xml_file != NULL && xml_file[0] != 0) {
        strcpy(filePath, xml_file);
    } else {
        static const char *fileName = "cm.xml";
        char *psetHome = getenv("PSETHOME");
        if(psetHome == NULL) {
            printf("Unable to get environment variable PSETHOME.\n");
            return 1;
        }
        sprintf(filePath, "%s/lib/%s", psetHome, fileName);
    }
    try {
        cmXml = new CmXml(filePath);
        cmXml->checkConsistency();
    }
    catch(const CmXmlException &ex) {
        printf("\nFATAL ERROR!!!\n");
        printf(ex.getMessage());
        return 1;
    }
    return 0;
}
static int initCmXml ( const char * xml_file ) { char filePath [ 1024 ] ; if ( xml_file != NULL && xml_file [ 0 ] != 0 ) { strcpy ( filePath , xml_file ) ; } else { static const char * fileName = " " ; char * psetHome = getenv ( " " ) ; if ( psetHome == NULL ) { printf ( " \n " ) ; return 1 ; } sprintf ( filePath , " " , psetHome , fileName ) ; } try { cmXml = new CmXml ( filePath ) ; cmXml -> checkConsistency ( ) ; } catch ( const CmXmlException & ex ) { printf ( " \n \n " ) ; printf ( ex . getMessage ( ) ) ; return 1 ; } return 0 ; }
Constructs object CmXml, which implements 'CM:Generic' interface.
Constructs object CmXml which implements ' CM : Generic ' interface .
// Use xml-file which was externaly specified. // Use pre-defined cm.xml file.