00001 /* -*- mode: C++ -*- 00002 * 00003 * Base class for finite state machine events 00004 * 00005 * Copyright (C) 2007, 2010, Austin Robot Technology 00006 * 00007 * License: Modified BSD Software License Agreement 00008 * 00009 * $Id: Blockage.h 435 2010-08-20 15:24:22Z jack.oquin $ 00010 */ 00011 00012 #ifndef __BLOCKAGE_h__ 00013 #define __BLOCKAGE_h__ 00014 00015 #include <art_map/Graph.h> 00016 #include "Path.h" 00017 #include <vector> 00018 00019 class block { 00020 public: 00021 block() {}; 00022 int count; 00023 double block_time; 00024 std::vector<WayPointEdge> added_blocks; 00025 std::vector<WayPointEdge> added_edges; 00026 }; 00027 00028 class Blockages { 00029 public: 00030 Blockages(Graph* graph, Path* path) : 00031 b_graph(graph), b_path(path) {} 00032 00033 bool empty() 00034 { 00035 return blocks.empty(); 00036 } 00037 00038 void pop_oldest(); 00039 void pop_newest(); 00040 void pop_block(uint index); 00041 void add_block(ElementID next); 00042 00043 private: 00044 Graph* b_graph; 00045 Path* b_path; 00046 00047 std::vector<block> blocks; 00048 }; 00049 00050 #endif