//---------------------------------------------------------------------------

#ifndef SoPLAH
#define SoPLAH

class SoPLA {
  private:
	unsigned int inputs;
	list<SoTerm> data;
    bool indexed;        // are indexes valid?

	vector<SoTermList::iterator> indexterm;		// vector of terms, if SoPLA is indexed

	vector<string> inames;          // names of input variables

	void Reindex(void);

public:

    SoPLA(void);
    SoPLA( const unsigned int iv );
    SoPLA( const SoPLA *_pla );			// This is not a copying constructor! Just creates PLA with the same dimensions and type
	~SoPLA(void);

	void clear(void);			// clears all the PLA structures

    // setters, getters
	unsigned int GetInputs(void) const {return inputs;};
	list<SoTerm> *GetData() {return &data;};		// returns pointer to data
    unsigned int GetTerms(void) const { return data.size(); };
	string GetIName(const unsigned int i) const;
	void SetIName(const unsigned int i, const string name);

	list<SoTerm>::iterator GetTerm(const unsigned int i);	// returns iterator to a term with a given index



	// data manipulation
	list<SoTerm>::iterator AppendTerm( const SoTerm &t );	// appends a term to the SoPLA
	list<SoTerm>::iterator AppendTerm( const string s );	// appends a term to the SoPLA
	void AppendPLA( const SoPLA &_pla );	// appends a given PLA. Terms are copied to the end

	// info functions

	bool empty(void) const;			// returns true if the SoPLA is empyt

};


//---------------------------------------------------------------------------
#endif
