|
From: Gerard F. <ger...@us...> - 2001-11-18 21:22:21
|
Update of /cvsroot/kuml/kuml/libkuml/mof
In directory usw-pr-cvs1:/tmp/cvs-serv12504
Modified Files:
ChangeLog Generic.cpp Generic.hh KumlUtilities.cpp
KumlUtilities.hh Makefile MofIdlReverseMapper.cpp
copyright.txt test_client.cpp
Added Files:
InterfaceGen.cpp InterfaceGen.hh MofGenericImplementer.cpp
MofGenericImplementer.hh MofGenericImplementer.t.cpp
Log Message:
2001-11-18 Gerard Flynn <ger...@fr...>
* Added InterfaceGen.hh and InterfaceGen.cpp
* Added implementations for GenericClassProxy::attribute,
operation, reference and superClass lookup methods to
Generic.cpp
* Added MofGenericImplementer.hh and .cpp and .t.cpp
VS: Committing in .
VS:
VS: Modified Files:
VS: ChangeLog Generic.cpp Generic.hh KumlUtilities.cpp
VS: KumlUtilities.hh Makefile MofIdlReverseMapper.cpp
VS: copyright.txt test_client.cpp
VS: Added Files:
VS: InterfaceGen.cpp InterfaceGen.hh MofGenericImplementer.cpp
VS: MofGenericImplementer.hh MofGenericImplementer.t.cpp
VS: gen/.cvsignore
VS: ----------------------------------------------------------------------
***** Error reading new file: [Errno 2] No such file or directory: 'InterfaceGen.cpp'
***** Error reading new file: [Errno 2] No such file or directory: 'InterfaceGen.hh'
***** Error reading new file: [Errno 2] No such file or directory: 'MofGenericImplementer.cpp'
***** Error reading new file: [Errno 2] No such file or directory: 'MofGenericImplementer.hh'
***** Error reading new file: [Errno 2] No such file or directory: 'MofGenericImplementer.t.cpp'
Index: ChangeLog
===================================================================
RCS file: /cvsroot/kuml/kuml/libkuml/mof/ChangeLog,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** ChangeLog 2001/08/03 02:03:05 1.5
--- ChangeLog 2001/11/18 21:22:18 1.6
***************
*** 1,4 ****
--- 1,11 ----
$Header$
+ 2001-11-18 Gerard Flynn <ger...@fr...>
+ * Added InterfaceGen.hh and InterfaceGen.cpp
+ * Added implementations for GenericClassProxy::attribute,
+ operation, reference and superClass lookup methods to
+ Generic.cpp
+ * Added MofGenericImplementer.hh and .cpp and .t.cpp
+
2001-8-3 Gerard Flynn <ger...@fr...>
* Added test_client
Index: Generic.cpp
===================================================================
RCS file: /cvsroot/kuml/kuml/libkuml/mof/Generic.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** Generic.cpp 2001/08/03 02:03:05 1.5
--- Generic.cpp 2001/11/18 21:22:18 1.6
***************
*** 1100,1103 ****
--- 1100,1140 ----
}
+ GenericAttribute* GenericClassProxy::attribute( const string& name )
+ {
+ featureMapIterator p = m_attributeNames.find( name );
+ if( p == m_attributeNames.end() ) {
+ return 0;
+ }
+ return dynamic_cast<GenericAttribute*>( p->second->feature );
+ }
+
+ GenericReference* GenericClassProxy::reference( const string& name )
+ {
+ featureMapIterator p = m_referenceNames.find( name );
+ if( p == m_referenceNames.end() ) {
+ return 0;
+ }
+ return dynamic_cast<GenericReference*>( p->second->feature );
+ }
+
+ GenericClassProxy* GenericClassProxy::superClass( const string& name )
+ {
+ classMapIterator p = m_superClassNames.find( name );
+ if( p == m_superClassNames.end() ) {
+ return 0;
+ }
+ return p->second;
+ }
+
+ GenericOperation* GenericClassProxy::operation( const string& name )
+ {
+ featureMapIterator p = m_operationNames.find( name );
+ if( p == m_operationNames.end() ) {
+ return 0;
+ }
+ return dynamic_cast<GenericOperation*>( p->second->feature );
+ }
+
+
stringVect GenericClassProxy::instanceLevelAttributeNames()
{
***************
*** 1130,1133 ****
--- 1167,1211 ----
}
+ stringVect GenericClassProxy::superClassNames()
+ {
+ stringVect retvect;
+ for( constClassVect::iterator p = m_superClasses.begin();
+ p != m_superClasses.end(); ++p )
+ {
+ retvect.push_back( (*p)->name() );
+ }
+ return retvect;
+ }
+
+ stringVect GenericClassProxy::instanceLevelOperationNames()
+ {
+ stringVect retvect;
+ featureVect::const_iterator p;
+ for( p = m_instanceLevelFeatures.begin();
+ p != m_instanceLevelFeatures.end(); ++p )
+ {
+ GenericOperation* op = dynamic_cast<GenericOperation*>( (*p)->feature );
+ if( op ) {
+ retvect.push_back( op->name() );
+ }
+ }
+ return retvect;
+ }
+
+ stringVect GenericClassProxy::classifierLevelOperationNames()
+ {
+ stringVect retvect;
+ featureVect::const_iterator p;
+ for( p = m_classifierLevelFeatures.begin();
+ p != m_classifierLevelFeatures.end(); ++p )
+ {
+ GenericOperation* op = dynamic_cast<GenericOperation*>( (*p)->feature );
+ if( op ) {
+ retvect.push_back( op->name() );
+ }
+ }
+ return retvect;
+ }
+
void GenericClassProxy::createServant()
{
***************
*** 1258,1262 ****
const CORBA::TypeCode* collection_type )
:GenericFeature( name, kind, scope, 0 ),
! m_multiplicity(multiplicity)
{
m_base_type = *base_type;
--- 1336,1341 ----
const CORBA::TypeCode* collection_type )
:GenericFeature( name, kind, scope, 0 ),
! m_isChangeable( isChangeable ),
! m_multiplicity( multiplicity )
{
m_base_type = *base_type;
***************
*** 1374,1380 ****
--- 1453,1469 ----
}
+ CORBA::TypeCode* GenericStructuralFeature::baseType()
+ {
+ return &m_base_type;
+ }
+
CORBA::TypeCode* GenericStructuralFeature::collectionType()
{
return &m_collection_type;
+ }
+
+ bool GenericStructuralFeature::isChangeable() const
+ {
+ return m_isChangeable;
}
Index: Generic.hh
===================================================================
RCS file: /cvsroot/kuml/kuml/libkuml/mof/Generic.hh,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** Generic.hh 2001/08/03 02:03:05 1.5
--- Generic.hh 2001/11/18 21:22:18 1.6
***************
*** 470,473 ****
--- 470,478 ----
stringVect classifierLevelAttributeNames();
+ stringVect superClassNames();
+
+ stringVect instanceLevelOperationNames();
+
+ stringVect classifierLevelOperationNames();
public: // MOF operations. (Value operations implemented in GenericInstance).
GenericInstanceSet all_objects( bool includeSubtypes );
***************
*** 769,774 ****
--- 774,782 ----
bool checkType( const Reflective::ValueType& element );
+ CORBA::TypeCode* baseType();
+
CORBA::TypeCode* collectionType();
+ bool isChangeable() const;
protected:
CORBA::TypeCode m_base_type;
Index: KumlUtilities.cpp
===================================================================
RCS file: /cvsroot/kuml/kuml/libkuml/mof/KumlUtilities.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** KumlUtilities.cpp 2001/06/30 07:31:26 1.1
--- KumlUtilities.cpp 2001/11/18 21:22:18 1.2
***************
*** 24,28 ****
/* ****************************************************************************/
! /* $Header$ */
#include "KumlUtilities.hh"
--- 24,30 ----
/* ****************************************************************************/
! /*
! $Header$
! */
#include "KumlUtilities.hh"
Index: KumlUtilities.hh
===================================================================
RCS file: /cvsroot/kuml/kuml/libkuml/mof/KumlUtilities.hh,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** KumlUtilities.hh 2001/06/30 07:31:26 1.1
--- KumlUtilities.hh 2001/11/18 21:22:18 1.2
***************
*** 24,28 ****
/* ****************************************************************************/
! /* $Header$ */
#ifndef KumlUtilities_H_IS_INCUDED
--- 24,30 ----
/* ****************************************************************************/
! /*
! $Header$
! */
#ifndef KumlUtilities_H_IS_INCUDED
***************
*** 71,74 ****
--- 73,131 ----
int m_nmatches;
}; // class RegularExpression.
+
+ class Indenter
+ {
+ friend ostream& operator<<( ostream& os, const Indenter& ind );
+ public:
+ Indenter()
+ :m_baseLevel(0),
+ m_currentLevel(0)
+ {}
+
+ Indenter& operator++()
+ {
+ m_currentLevel++;
+ return *this;
+ }
+
+ Indenter& operator+=( int i )
+ {
+ m_currentLevel += i;
+ return *this;
+ }
+
+ Indenter& operator--()
+ {
+ m_currentLevel--;
+ return *this;
+ }
+
+ Indenter& operator-=( int i )
+ {
+ m_currentLevel -= i;
+ return *this;
+ }
+
+ void setBaseLevel( int i ) { m_baseLevel = i; restoreBaseLevel(); }
+
+ void setCurrentLevel( int i ) { m_currentLevel = i; };
+
+ void restoreBaseLevel() { m_currentLevel = m_baseLevel; }
+
+ void addToBaseLevel( int i ) { m_baseLevel += i; restoreBaseLevel(); }
+ private:
+ int m_baseLevel;
+
+ int m_currentLevel;
+ }; // End of class Indenter.
+
+ inline ostream& operator<< ( ostream& os, const Indenter& ind )
+ {
+ for( int i = 0; i < ind.m_currentLevel; i++ ) {
+ os << " ";
+ }
+ return os;
+ }
+
} // namespace KumlUtilities.
Index: Makefile
===================================================================
RCS file: /cvsroot/kuml/kuml/libkuml/mof/Makefile,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** Makefile 2001/08/03 02:03:05 1.5
--- Makefile 2001/11/18 21:22:18 1.6
***************
*** 9,13 ****
CPPFLAGS = ${CXXFLAGS}
! all : RegularExpression.t RepoManager.t test_client
#Generic.t : Generic.t.o Generic.o Reflective.o Reflective_impl.o GenericTest.o GenericTest.h \
--- 9,13 ----
CPPFLAGS = ${CXXFLAGS}
! all : RegularExpression.t RepoManager.t test_client MofGenericImplementer.t
#Generic.t : Generic.t.o Generic.o Reflective.o Reflective_impl.o GenericTest.o GenericTest.h \
***************
*** 40,43 ****
--- 40,47 ----
test_client_OBJECTS = test_client.o Reflective.o mCorba.o
+ MofGenericImplementer_t_OBJECTS = MofGenericImplementer.t.o MofGenericImplementer.o \
+ Generic.o mCorba.o Reflective.o Reflective_impl.o MetaModelManager.o KumlUtilities.o \
+ InterfaceGen.o
+
RepoManager.t : ${RepoManager_t_OBJECTS}
g++ -o $@ $^ ${LIBS}
***************
*** 46,49 ****
--- 50,55 ----
g++ -o $@ $^ ${LIBS}
+ MofGenericImplementer.t : ${MofGenericImplementer_t_OBJECTS}
+ g++ -o $@ $^ ${LIBS}
RegularExpression.t : RegularExpression.t.o KumlUtilities.o
***************
*** 96,103 ****
rm -f *.o Generic.t yacc.cc.h yacc.h scanner.cc yacc.cc
rm -f MofIdlMapping.t RegularExpression.t RepoManager.t
rm -f *.d
rm -f yacc.cc.output
! OBJECTS = ${RepoManager_t_OBJECTS}
include $(OBJECTS:.o=.d)
--- 102,110 ----
rm -f *.o Generic.t yacc.cc.h yacc.h scanner.cc yacc.cc
rm -f MofIdlMapping.t RegularExpression.t RepoManager.t
+ rm -f MofGenericImplementer.t
rm -f *.d
rm -f yacc.cc.output
! OBJECTS = ${RepoManager_t_OBJECTS} ${MofGenericImplemnter_t_OBJECTS}
include $(OBJECTS:.o=.d)
Index: MofIdlReverseMapper.cpp
===================================================================
RCS file: /cvsroot/kuml/kuml/libkuml/mof/MofIdlReverseMapper.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** MofIdlReverseMapper.cpp 2001/07/15 11:14:31 1.4
--- MofIdlReverseMapper.cpp 2001/11/18 21:22:18 1.5
***************
*** 165,169 ****
}
else { // real operation
!
}
--- 165,169 ----
}
else { // real operation
! // Add opMapper to our real-op list.
}
***************
*** 493,503 ****
// Add operations
-
// Not implemented yet.
// Add super-classes
-
- // Not implemented yet
-
cerr << "Before parent adding loop" << endl;
Interface::stringSet parent_names = p_interface->getParentNames();
--- 493,499 ----
Index: copyright.txt
===================================================================
RCS file: /cvsroot/kuml/kuml/libkuml/mof/copyright.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** copyright.txt 2001/06/22 03:42:04 1.1
--- copyright.txt 2001/11/18 21:22:18 1.2
***************
*** 24,25 ****
--- 24,28 ----
/* ****************************************************************************/
+ /*
+ $Header$
+ */
Index: test_client.cpp
===================================================================
RCS file: /cvsroot/kuml/kuml/libkuml/mof/test_client.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** test_client.cpp 2001/08/03 21:32:38 1.1
--- test_client.cpp 2001/11/18 21:22:18 1.2
***************
*** 50,53 ****
--- 50,60 ----
assert( ! CORBA::is_nil( refObj.in() ) );
+
+ Reflective::RefPackage_var modelPackage = Reflective::RefPackage::_narrow( refObj.in() );
+ assert( ! CORBA::is_nil( modelPackage.in() ) );
+
+ Reflective::RefObject_var meta_modelPackage = modelPackage->ref_meta_object();
+ assert( ! CORBA::is_nil( meta_modelPackage.in() ) );
+
cerr << "End (test_client)" << endl;
return 0;
|