ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/src/types/BondStamp.hpp
(Generate patch)

Comparing trunk/OOPSE-3.0/src/types/BondStamp.hpp (file contents):
Revision 1930 by gezelter, Wed Jan 12 22:41:40 2005 UTC vs.
Revision 2544 by tim, Wed Jan 11 19:01:20 2006 UTC

# Line 1 | Line 1
1 < /*
1 > /*
2   * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved.
3   *
4   * The University of Notre Dame grants you ("Licensee") a
# Line 42 | Line 42
42   #ifndef TYPES_BONDSTAMP_HPP
43   #define TYPES_BONDSTAMP_HPP
44  
45 < #include "io/LinkedAssign.hpp"
45 > #include "types/DataHolder.hpp"
46  
47 < class BondStamp{
47 > namespace oopse {
48 > class BondStamp : public DataHolder {
49  
50 < public:
51 <  BondStamp();
52 <  ~BondStamp();
53 <  
54 <  void assignString( char* lhs, char* rhs );
55 <  void assignDouble( char* lhs, double rhs );
56 <  void assignInt( char* lhs, int rhs );
57 <  void members( int the_a, int the_b );
58 <  void constrain( double the_constraint );
59 <  char* checkMe( void );
50 >    public:
51 >      void setMembers(std::vector<int> members) {
52 >        if (members.size() ==2) {
53 >            a = members[0];
54 >            b = members[1];
55 >            if (a < 0 || b < 0) {
56 >                std::ostringstream oss;
57 >                oss << "BondStamp Error: members" << containerToString(members) << " is an invalid" << std::endl;
58 >                throw OOPSEException(oss.str());
59 >            }
60 >        } else {
61 >            std::ostringstream oss;
62 >            oss << "BondStamp Error: members" << containerToString(members) << " is an invalid" << std::endl;
63 >            throw OOPSEException(oss.str());
64 >        }
65 >        
66  
67 <  int getA( void ){ return a; }
68 <  int getB( void ){ return b; }
69 <
70 <  int haveExtras( void ) { return have_extras; }
71 <  LinkedAssign* getExtras( void ) { return unhandled; }
72 <
73 < private:
67 <
68 <  int a, b; //the members
69 <  double constraint;
70 <  short int have_mbrs, have_constraint;
71 <
72 <  LinkedAssign* unhandled; // the unhandled assignments
73 <  short int have_extras;
74 <
67 >      }
68 >      
69 >      int getA() {return a;}
70 >      int getB() {return b;}
71 >    private:
72 >        int a;
73 >        int b;
74   };
75  
76 <
76 > }
77   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines