equal
deleted
inserted
replaced
410 /// |
410 /// |
411 ///\note The <tt>Edge</tt>s |
411 ///\note The <tt>Edge</tt>s |
412 ///referencing a moved edge remain |
412 ///referencing a moved edge remain |
413 ///valid. However <tt>InEdge</tt>'s and <tt>OutEdge</tt>'s |
413 ///valid. However <tt>InEdge</tt>'s and <tt>OutEdge</tt>'s |
414 ///may be invalidated. |
414 ///may be invalidated. |
415 ///\warning This functionality cannot be used together with the SnapShot |
415 ///\warning This functionality cannot be used together with the Snapshot |
416 ///feature. |
416 ///feature. |
417 ///\todo It could be implemented in a bit faster way. |
417 ///\todo It could be implemented in a bit faster way. |
418 Node split(Node n, bool connect = true) |
418 Node split(Node n, bool connect = true) |
419 { |
419 { |
420 Node b = addNode(); |
420 Node b = addNode(); |
434 /// |
434 /// |
435 ///The newly added nodes and edges can be removed using the |
435 ///The newly added nodes and edges can be removed using the |
436 ///restore() function. |
436 ///restore() function. |
437 /// |
437 /// |
438 ///\warning Edge and node deletions cannot be restored. |
438 ///\warning Edge and node deletions cannot be restored. |
439 ///\warning SnapShots cannot be nested. |
439 ///\warning Snapshots cannot be nested. |
440 ///\todo \c SnapShot or \c Snapshot? |
440 class Snapshot : protected AlterationNotifier<Node>::ObserverBase, |
441 class SnapShot : protected AlterationNotifier<Node>::ObserverBase, |
|
442 protected AlterationNotifier<Edge>::ObserverBase |
441 protected AlterationNotifier<Edge>::ObserverBase |
443 { |
442 { |
444 protected: |
443 protected: |
445 |
444 |
446 ListGraph *g; |
445 ListGraph *g; |
494 ///Default constructur. |
493 ///Default constructur. |
495 |
494 |
496 ///Default constructur. |
495 ///Default constructur. |
497 ///To actually make a snapshot you must call save(). |
496 ///To actually make a snapshot you must call save(). |
498 /// |
497 /// |
499 SnapShot() : g(0) {} |
498 Snapshot() : g(0) {} |
500 ///Constructor that immediately makes a snapshot. |
499 ///Constructor that immediately makes a snapshot. |
501 |
500 |
502 ///This constructor immediately makes a snapshot of the graph. |
501 ///This constructor immediately makes a snapshot of the graph. |
503 ///\param _g The graph we make a snapshot of. |
502 ///\param _g The graph we make a snapshot of. |
504 SnapShot(ListGraph &_g) { |
503 Snapshot(ListGraph &_g) { |
505 regist(_g); |
504 regist(_g); |
506 } |
505 } |
507 ///\bug Is it necessary? |
506 ///\bug Is it necessary? |
508 /// |
507 /// |
509 ~SnapShot() |
508 ~Snapshot() |
510 { |
509 { |
511 if(g) deregist(); |
510 if(g) deregist(); |
512 } |
511 } |
513 |
512 |
514 ///Make a snapshot. |
513 ///Make a snapshot. |
571 ///It conforms to the |
570 ///It conforms to the |
572 ///\ref concept::UndirGraph "UndirGraph" concept. |
571 ///\ref concept::UndirGraph "UndirGraph" concept. |
573 /// |
572 /// |
574 ///\sa concept::UndirGraph. |
573 ///\sa concept::UndirGraph. |
575 /// |
574 /// |
576 ///\todo SnapShot, reverseEdge(), changeTarget(), changeSource(), contract() |
575 ///\todo Snapshot, reverseEdge(), changeTarget(), changeSource(), contract() |
577 ///haven't been implemented yet. |
576 ///haven't been implemented yet. |
578 /// |
577 /// |
579 class UndirListGraph : public ExtendedUndirListGraphBase { |
578 class UndirListGraph : public ExtendedUndirListGraphBase { |
580 public: |
579 public: |
581 typedef ExtendedUndirListGraphBase Parent; |
580 typedef ExtendedUndirListGraphBase Parent; |