00001 // $Id$ 00002 // vim:tabstop=2 00003 /*********************************************************************** 00004 Moses - factored phrase-based language decoder 00005 Copyright (C) 2010 Hieu Hoang 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Lesser General Public 00009 License as published by the Free Software Foundation; either 00010 version 2.1 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public 00018 License along with this library; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 ***********************************************************************/ 00021 00022 #pragma once 00023 00024 #include <boost/shared_ptr.hpp> 00025 00026 #include <vector> 00027 00028 namespace Moses 00029 { 00030 class ChartTrellisPath; 00031 00032 class ChartTrellisPathList 00033 { 00034 protected: 00035 typedef std::vector<boost::shared_ptr<const ChartTrellisPath> > CollType; 00036 CollType m_collection; 00037 00038 public: 00039 // iters 00040 typedef CollType::iterator iterator; 00041 typedef CollType::const_iterator const_iterator; 00042 00043 iterator begin() { 00044 return m_collection.begin(); 00045 } 00046 iterator end() { 00047 return m_collection.end(); 00048 } 00049 const_iterator begin() const { 00050 return m_collection.begin(); 00051 } 00052 const_iterator end() const { 00053 return m_collection.end(); 00054 } 00055 void clear() { 00056 m_collection.clear(); 00057 } 00058 00059 virtual ~ChartTrellisPathList() {} 00060 00061 std::size_t GetSize() const { 00062 return m_collection.size(); 00063 } 00064 00066 void Add(boost::shared_ptr<const ChartTrellisPath> trellisPath) { 00067 m_collection.push_back(trellisPath); 00068 } 00069 }; 00070 00071 } // namespace 00072