ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/generic_stamps/BondStamp.cpp
Revision: 11
Committed: Tue Jul 9 18:40:59 2002 UTC (22 years ago) by mmeineke
File size: 1144 byte(s)
Log Message:
This commit was generated by cvs2svn to compensate for changes in r10, which
included commits to RCS files with non-trunk default branches.

File Contents

# Content
1 #include <cstdlib>
2 #include <cstring>
3
4 #include "BondStamp.hpp"
5
6 BondStamp::BondStamp(){
7
8 have_mbrs = 0;
9 have_constraint = 0;
10
11 unhandled = NULL;
12 have_extras = 0;
13 }
14
15 BondStamp::~BondStamp(){
16
17 if( unhandled != NULL ) delete unhandled;
18 }
19
20 void BondStamp::members( int the_a, int the_b ){
21
22 a = the_a;
23 b = the_b;
24 have_mbrs = 1;
25 }
26
27 void BondStamp::constrain( double the_constraint ){
28
29 constraint = the_constraint;
30 have_constraint = 1;
31 }
32
33 void BondStamp::assignString( char* lhs, char* rhs ){
34
35 if( unhandled == NULL ) unhandled = new LinkedAssign( lhs, rhs );
36 else unhandled->add( lhs, rhs );
37 have_extras = 1;
38 }
39
40 void BondStamp::assignDouble( char* lhs, double rhs ){
41
42 if( unhandled == NULL ) unhandled = new LinkedAssign( lhs, rhs );
43 else unhandled->add( lhs, rhs );
44 have_extras = 1;
45 }
46
47 void BondStamp::assignInt( char* lhs, int rhs ){
48
49 if( unhandled == NULL ) unhandled = new LinkedAssign( lhs, rhs );
50 else unhandled->add( lhs, rhs );
51 have_extras = 1;
52 }
53
54 char* BondStamp::checkMe(){
55
56 if( !have_mbrs ){
57 return strdup( "BondStamp error. Bond was not given members." );
58 }
59
60 return NULL;
61 }