version 1.10, 2001/07/16 21:59:59
|
version 1.11, 2002/03/17 17:43:53
|
|
|
// | // |
// | // |
// | // |
// CIMRepository implementation for use in the cimmof compiler. |
// This class acts as a buffer between the compiler and the repository |
// Basically, it adds compiler-level methods and provides error handling |
// interface. Thie main thing it does is registers a non-standard |
|
// DeclContext so we can do local checking of context for new objects |
// | // |
| |
#include "cimmofRepository.h" | #include "cimmofRepository.h" |
| |
|
PEGASUS_USING_PEGASUS; |
|
|
cimmofRepository::cimmofRepository(const String &path, | cimmofRepository::cimmofRepository(const String &path, |
compilerCommonDefs::operationType ot) : | compilerCommonDefs::operationType ot) : |
_cimrepository(0), _context(0), _ot(ot) | _cimrepository(0), _context(0), _ot(ot) |
|
|
} | } |
| |
int | int |
cimmofRepository::addClass(CIMClass *classdecl) |
cimmofRepository::addClass(const String &nameSpace, CIMClass *classdecl) |
{ | { |
const String &Sns = (cimmofParser::Instance())->getNamespacePath(); |
// Don't catch errors: pass them up to the requester |
_context->addClass( Sns, *classdecl); |
_context->addClass( nameSpace, *classdecl); |
// FIXME: catch errors |
|
return 0; | return 0; |
} | } |
| |
| |
int | int |
cimmofRepository::addInstance(CIMInstance *instance) |
cimmofRepository::addInstance(const String &nameSpace, CIMInstance *instance) |
{ | { |
const String &Sns = (cimmofParser::Instance())->getNamespacePath(); |
// Don't catch errors: pass them up to the requester |
_context->addInstance(Sns, *instance); |
_context->addInstance(nameSpace, *instance); |
// FIXME: catch errors |
|
return 0; | return 0; |
} | } |
| |
int | int |
cimmofRepository::addQualifier(CIMQualifierDecl *qualifier) |
cimmofRepository::addQualifier(const String &nameSpace, |
|
CIMQualifierDecl *qualifier) |
{ | { |
const String &Sns = cimmofParser::Instance()->getNamespacePath(); |
// Don't catch errors: pass them up to the requester |
_context->addQualifierDecl(Sns, *qualifier); |
_context->addQualifierDecl(nameSpace, *qualifier); |
// FIXME: catch errors |
|
return 0; | return 0; |
} | } |
| |
CIMQualifierDecl | CIMQualifierDecl |
cimmofRepository::getQualifierDecl(const String &name) |
cimmofRepository::getQualifierDecl(const String &nameSpace, const String &name) |
{ | { |
const String &Sns = cimmofParser::Instance()->getNamespacePath(); |
// Don't catch errors: pass them up to the requester |
return _context->lookupQualifierDecl(Sns, name); |
return _context->lookupQualifierDecl(nameSpace, name); |
} | } |
| |
CIMClass | CIMClass |
cimmofRepository::getClass(const String &classname) |
cimmofRepository::getClass(const String &nameSpace, const String &classname) |
{ | { |
const String &Sns = cimmofParser::Instance()->getNamespacePath(); |
// Don't catch errors: pass them up to the requester |
return _context->lookupClass(Sns, classname); |
return _context->lookupClass(nameSpace, classname); |
} | } |
| |
void | void |