/*!
@header FTGraphManagerImpl
@abstract Module of FT
@availability OS X, GNUstep
@copyright 2004, 2005, 2006 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-------------------------------------------------------------------------
Modification history
23.02.05 ola initial version
19.08.06 ola removeGraphWithId added, allGraphIds completed
23.08.06 ola license changed
-------------------------------------------------------------------------
*/
#if !defined(__FTGraphManagerImpl_H)
#define __FTGraphManagerImpl_H
#include
#include
#include
#include
#include
#include
@class FTServerImpl;
/*!
* @class FTGraphManagerImpl
* @abstract Instances of this class are used to fetch, create etc. graphs
*/
@interface FTGraphManagerImpl : FTObject {
@private
NSLock *lock;
FTServerImpl *server;
BDBDatabase *graphIdToGraphDatabase;
/*!
* Contains all graphs being in memory at present
*/
ECCache *graphIdToGraphCache;
}
/*!
* @method initWithDatabase
* @abstract initializes the receiver handing off its database
* @param theServer the server under which this instance runs
* @param theDatabase reference to the graphidToGraph database
*/
- initForServer: (FTServerImpl *) theServer
withGraphIdToGraphDatabase: (BDBDatabase *) theDatabase;
- (void) dealloc;
/*!
* @method allGraphIds
* @result an iterator of all graph id's this graph manager manages or
* an empty iterator, if no graph exists
*/
- (id ) allGraphIds;
/*!
* @method createGraphWithId
* @abstract create a graph using the given id
* @param graphId underlying id to use
* @result created graph
* @throws ECIllegalArgumentException if a graph with the same identifier
* already exists
*/
- (id ) createGraphWithId: (id ) graphId;
/*!
* @method graphWithId
* @abstract load the graph with the given id
* @result the graph with the given id or nil, if it does not exist
*/
- (id ) graphWithId: (id ) graphId;
/*!
* @method lookupGraphWithId
* @abstract return the graph corresponding to the given id, if existent
* @result graph corresponding to the given id, if existent
*/
- (FTGraphImpl *) lookupGraphWithId: (id ) graphId;
/*!
* @method releaseGraph
* @abstract Informs the receiver that a graph may be removed from the cache
* @param item item to remove
*/
- (void) releaseGraph: (FTGraphImpl *) item;
/*!
* @method removeGraphWithId
* @param graphId id of graph to remove
* @abstract removes the specified graph or does nothing, if the graph does not
* exist
* @result self
*/
- removeGraphWithId: (id ) graphId;
@end
#endif