00001 00005 /* Copyright © 2009, 2010 James Legg. 00006 This program is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 */ 00011 00012 #ifndef CHANGE_VERTEX_SEGMENT_DELTA_H_ 00013 #define CHANGE_VERTEX_SEGMENT_DELTA_H_ 00014 00015 #include <cstddef> 00016 00017 #include "ChangePropertyDelta.h" 00018 #include "StackableDelta.h" 00019 00020 namespace Document 00021 { 00022 00025 class VertexSegmentFinder : public PropertyDeltaIdentifier<std::size_t> 00026 { 00027 public: 00031 VertexSegmentFinder(std::size_t node_id); 00038 virtual void read(const Track::Track & track, std::size_t & segment_index); 00043 virtual void write(Track::Track & track, const std::size_t & new_segment_index); 00044 00046 std::size_t get_vertex_name() const; 00047 protected: 00049 std::size_t node_id; 00050 }; 00051 00056 typedef ChangePropertyDelta<VertexSegmentFinder, std::size_t> ChangeVertexSegmentOnlyDelta; 00057 00062 class ChangeVertexSegmentDelta 00063 : public StackableDelta 00064 { 00065 public: 00071 ChangeVertexSegmentDelta(VertexSegmentFinder vertex_segment_finder, std::size_t new_segment_index); 00072 00073 virtual void apply(Track::Track & track); 00074 protected: 00075 VertexSegmentFinder vertex_segment_finder; 00076 std::size_t new_segment_index; 00077 }; 00078 00079 } 00080 00081 #endif // CHANGE_VERTEX_SEGMENT_DELTA_H_
Generated at Mon Sep 6 00:41:11 2010 by Doxygen version 1.4.7 for Racer version svn335.