SpeciesHandler.h 1.91 KB
Newer Older
Francois Gygi committed
1 2
////////////////////////////////////////////////////////////////////////////////
//
Francois Gygi committed
3
// Copyright (c) 2008-2012 The Regents of the University of California
Francois Gygi committed
4 5 6
//
// This file is part of Qbox
//
Francois Gygi committed
7 8
// Qbox is distributed under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 2 of
Francois Gygi committed
9 10 11 12 13 14
// the License, or (at your option) any later version.
// See the file COPYING in the root directory of this distribution
// or <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////
//
Francois Gygi committed
15 16 17 18 19 20 21 22 23 24 25 26 27 28
// SpeciesHandler.h
//
////////////////////////////////////////////////////////////////////////////////

#ifndef SPECIESHANDLER_H
#define SPECIESHANDLER_H

#include "StructureHandler.h"

class Species;

class SpeciesHandler : public StructureHandler
{
  private:
29

Francois Gygi committed
30
  Species& sp_;
31
  int current_l, current_size, current_i, current_j;
32
  std::string current_name, current_href;
Francois Gygi committed
33
  double current_interval;
34 35 36 37 38 39 40
  bool d_ij_alloc;

  // read attributes
  void read(const Attributes& attributes);

  // allocate array for d_ij matrix
  void alloc_d_ij();
41

Francois Gygi committed
42
  public:
43

Francois Gygi committed
44 45 46 47 48
  // Start of an element handled by SpeciesHandler
  virtual void startElement(const XMLCh* const uri,const XMLCh* const localname,
      const XMLCh* const qname, const Attributes& attributes);

  // End of an element handled by SpeciesHandler
49
  virtual void endElement(const XMLCh* const uri, const XMLCh* const localname,
50
      const XMLCh* const qname, std::string& content);
51

Francois Gygi committed
52 53
  // start a subHandler if possible
  virtual StructureHandler* startSubHandler(const XMLCh* const uri,
54
    const XMLCh* const localname, const XMLCh* const qname,
Francois Gygi committed
55
    const Attributes& attributes);
56

Francois Gygi committed
57 58
  // end subHandler
  virtual void endSubHandler(const XMLCh* const uri,
59
    const XMLCh* const localname, const XMLCh* const qname,
Francois Gygi committed
60 61 62 63 64 65
    const StructureHandler* const subHandler);

  SpeciesHandler(Species& sp);
  ~SpeciesHandler();
};
#endif