ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-1.0/libBASS/BondStamp.cpp
Revision: 1334
Committed: Fri Jul 16 18:58:03 2004 UTC (19 years, 11 months ago) by gezelter
File size: 1146 byte(s)
Log Message:
Initial import of OOPSE-1.0 source tree

File Contents

# User Rev Content
1 gezelter 1334 #include <stdlib.h>
2     #include <string.h>
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     }