From e6636042890e1dbfc442dfa0fedd9797c7cb8eff Mon Sep 17 00:00:00 2001 From: randomguy3 Date: Sat, 10 Mar 2012 13:37:44 +0000 Subject: Make common code KVC compliant, and implement NSCopying where relevant git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@420 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64 --- tikzit/src/common/Graph.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'tikzit/src/common/Graph.h') diff --git a/tikzit/src/common/Graph.h b/tikzit/src/common/Graph.h index e629464..c680219 100644 --- a/tikzit/src/common/Graph.h +++ b/tikzit/src/common/Graph.h @@ -44,7 +44,7 @@ Graph changes can be re-done by calling applyGraphChange. They can be undone by calling applyGraphChange on [change inverse]. */ -@interface Graph : NSObject { +@interface Graph : NSObject { NSRecursiveLock *graphLock; BOOL dirty; // keep track of when inEdges and outEdges need an update NSMutableArray *nodes; @@ -63,6 +63,13 @@ */ @property (copy) GraphElementData *data; +// KVC methods +- (void) insertObject:(GraphElementProperty*)gep + inDataAtIndex:(NSUInteger)index; +- (void) removeObjectFromDataAtIndex:(NSUInteger)index; +- (void) replaceObjectInDataAtIndex:(NSUInteger)index + withObject:(GraphElementProperty*)gep; + /*! @property nodes @brief The set of nodes. @@ -128,6 +135,14 @@ */ - (Graph*)copyOfSubgraphWithNodes:(NSSet*)nds; +/*! + @brief Gives a copy of the full subgraph with the given nodes. + @param nds a set of nodes. + @param zone an allocation zone + @result A subgraph. + */ +- (Graph*)copyOfSubgraphWithNodes:(NSSet*)nds zone:(NSZone*)zone; + /*! @brief Gives a set of edge-arrays that partition all of the edges in the graph. @result An NSet of NSArrays of edges. @@ -313,6 +328,8 @@ */ + (NSMapTable*)nodeTableForNodes:(NSSet*)nds; ++ (NSMapTable*)nodeTableForNodes:(NSSet*)nds withZone:(NSZone*)zone; + /*! @brief Copy the edge set and return a table of copies, whose keys are the original edges. This is used to save the state @@ -322,6 +339,8 @@ */ + (NSMapTable*)edgeTableForEdges:(NSSet*)es; ++ (NSMapTable*)edgeTableForEdges:(NSSet*)es withZone:(NSZone*)zone; + /*! @brief Compute the bounds for a set of nodes. @param nds an enumerable collection of nodes. -- cgit v1.2.3