|
From: Frank V. C. <fr...@us...> - 2001-04-12 11:58:15
|
Update of /cvsroot/corelinux/clfw/src/libs/Persist
In directory usw-pr-cvs1:/tmp/cvs-serv13585/src/libs/Persist
Modified Files:
Makefile.am SchemaCatalog.cpp
Added Files:
Store.cpp
Log Message:
Adding last piece to Schema and Persist Puzzle, the real deal interfaces to storage
***** Error reading new file: [Errno 2] No such file or directory: 'Store.cpp'
Index: Makefile.am
===================================================================
RCS file: /cvsroot/corelinux/clfw/src/libs/Persist/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Makefile.am 2001/04/08 10:50:43 1.3
--- Makefile.am 2001/04/12 11:56:53 1.4
***************
*** 17,21 ****
SchemaSponsor.cpp \
StoreCatalog.cpp \
! SchemaCatalog.cpp
--- 17,22 ----
SchemaSponsor.cpp \
StoreCatalog.cpp \
! SchemaCatalog.cpp \
! Store.cpp
Index: SchemaCatalog.cpp
===================================================================
RCS file: /cvsroot/corelinux/clfw/src/libs/Persist/SchemaCatalog.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** SchemaCatalog.cpp 2001/04/11 01:39:25 1.4
--- SchemaCatalog.cpp 2001/04/12 11:56:53 1.5
***************
*** 148,151 ****
--- 148,153 ----
void SchemaCatalog::createEntry( CollectionPtr aCollection )
{
+ REQUIRE( aCollection != NULLPTR );
+
CollectionPtr aSchemaCol( NULLPTR );
FrameworkString aUid;
***************
*** 170,205 ****
//
! // Get the collection instance
//
! aSchemaCol = this->resolveCollectionAssignment(aCollection);
! //
! // Get unique identifier for schema
! //
! aUid = this->resolveUuidAssignment(aCollection);
! //
! // Create and assign name and collection
! //
! SchemaPtr aSchema = this->createSchema( aUid, *aName, aSchemaCol );
! //
! // Serialize the first part to the location
! //
! this->saveSchema( aSchema );
! //
! // Make the catalog entry and persist
! //
! //
! // Get rid of the Schema
! //
! Schema::destroy( aSchema );
}
--- 172,205 ----
//
! // Find and resuse if possible
//
! Attribute catSearch;
! catSearch.setKey( aName );
! if( theSchemas.containsElement(&catSearch) == false )
! {
! // Get the collection instance
! aSchemaCol = this->resolveCollectionAssignment(aCollection);
! // Get unique identifier for schema
! aUid = this->resolveUuidAssignment(aCollection);
! // Create and assign name and collection
! SchemaPtr aSchema = this->createSchema( aUid, *aName, aSchemaCol );
! // Make the catalog entry and persist
! // Serialize the first part to the location
! this->saveSchema( aSchema );
! }
! else
! {
! ; // do nothing, already exists
! }
}
***************
*** 208,213 ****
//
! void SchemaCatalog::deleteEntry( CollectionPtr )
{
}
--- 208,214 ----
//
! void SchemaCatalog::deleteEntry( CollectionPtr aCollection )
{
+ REQUIRE( aCollection != NULLPTR );
}
***************
*** 218,227 ****
//
! FrameworkEntityPtr SchemaCatalog::getEntry( CollectionPtr ) const
{
SchemaPtr aSchm( NULLPTR );
return aSchm;
}
void SchemaCatalog::saveSchema( SchemaPtr )
{
--- 219,267 ----
//
! FrameworkEntityPtr SchemaCatalog::getEntry
! (
! CollectionPtr aCollection
! ) const
{
+ REQUIRE( aCollection != NULLPTR );
+
SchemaPtr aSchm( NULLPTR );
+
+ //
+ // Check for instance based on name or uuid
+ //
+
+ FrameworkStringPtr aName
+ (
+ this->resolveValueAssignment(aCollection,&nameKey)
+ );
+
+ if( aName != NULLPTR )
+ {
+ Attribute srchAttr;
+ srchAttr.setKey(aName);
+
+ if( theSchemas.containsElement( &srchAttr ) == true )
+ {
+
+ }
+ else
+ {
+ ; // return null, not found
+ }
+ }
+ else
+ {
+
+ }
+
+
return aSchm;
}
+ //
+ // Save the schema
+ //
+
void SchemaCatalog::saveSchema( SchemaPtr )
{
***************
*** 229,232 ****
--- 269,276 ----
}
+ //
+ // Close the schema and remove from memory
+ //
+
void SchemaCatalog::closeSchema( SchemaPtr )
{
***************
*** 294,297 ****
--- 338,345 ----
}
+ //
+ // Resolve or default the schema collection type
+ //
+
CollectionPtr SchemaCatalog::resolveCollectionAssignment
(
***************
*** 345,349 ****
CollectionPtr aCollection,
FrameworkStringPtr aValue
! )
{
FrameworkStringPtr aResult(NULLPTR);
--- 393,397 ----
CollectionPtr aCollection,
FrameworkStringPtr aValue
! ) const
{
FrameworkStringPtr aResult(NULLPTR);
|