/* -*- c++ -*-
 *
 * SOCLIB_LGPL_HEADER_BEGIN
 * 
 * This file is part of SoCLib, GNU LGPLv2.1.
 * 
 * SoCLib is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; version 2.1 of the License.
 * 
 * SoCLib is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with SoCLib; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA
 * 
 * SOCLIB_LGPL_HEADER_END
 *
 * Copyright (c) Telecom ParisTech, Comelec 
 *         Jeremie Brunel <jeremie.brunel@telecom-paristech.fr>, 2013
 *
 */
#ifndef SOCLIB_CABA_VCD_PARSER
#define SOCLIB_CABA_VCD_PARSER

#include <string>
#include <map>
#include <fstream>
#include "stdint.h"

namespace soclib
{
  namespace common
  {
    class VcdParser
    {
      public:
        VcdParser(const std::string &filename);
        void clean(const std::string, uint32_t);
        std::map<std::string, uint32_t> get_next_wave(uint32_t *time, bool clean, std::string key, uint32_t val);
        ~VcdParser();

      private:
        std::ifstream m_file;
        std::map<std::string, std::pair<std::string, uint32_t> > m_keys_table;
        std::pair<std::string, uint32_t> parse_line(std::string &line);
        std::map<std::string, uint32_t> construct_map();
        std::map<std::string, uint32_t> next_wave(uint32_t *time);
    };
  }
}

#endif
