43 |
|
#include <string.h> |
44 |
|
|
45 |
|
#include "types/BondStamp.hpp" |
46 |
+ |
namespace oopse { |
47 |
|
|
47 |
– |
BondStamp::BondStamp(){ |
48 |
– |
|
49 |
– |
have_mbrs = 0; |
50 |
– |
have_constraint = 0; |
51 |
– |
|
52 |
– |
unhandled = NULL; |
53 |
– |
have_extras = 0; |
54 |
– |
} |
48 |
|
|
56 |
– |
BondStamp::~BondStamp(){ |
57 |
– |
|
58 |
– |
if( unhandled != NULL ) delete unhandled; |
49 |
|
} |
60 |
– |
|
61 |
– |
void BondStamp::members( int the_a, int the_b ){ |
62 |
– |
|
63 |
– |
a = the_a; |
64 |
– |
b = the_b; |
65 |
– |
have_mbrs = 1; |
66 |
– |
} |
67 |
– |
|
68 |
– |
void BondStamp::constrain( double the_constraint ){ |
69 |
– |
|
70 |
– |
constraint = the_constraint; |
71 |
– |
have_constraint = 1; |
72 |
– |
} |
73 |
– |
|
74 |
– |
void BondStamp::assignString( char* lhs, char* rhs ){ |
75 |
– |
|
76 |
– |
if( unhandled == NULL ) unhandled = new LinkedAssign( lhs, rhs ); |
77 |
– |
else unhandled->add( lhs, rhs ); |
78 |
– |
have_extras = 1; |
79 |
– |
} |
80 |
– |
|
81 |
– |
void BondStamp::assignDouble( char* lhs, double rhs ){ |
82 |
– |
|
83 |
– |
if( unhandled == NULL ) unhandled = new LinkedAssign( lhs, rhs ); |
84 |
– |
else unhandled->add( lhs, rhs ); |
85 |
– |
have_extras = 1; |
86 |
– |
} |
87 |
– |
|
88 |
– |
void BondStamp::assignInt( char* lhs, int rhs ){ |
89 |
– |
|
90 |
– |
if( unhandled == NULL ) unhandled = new LinkedAssign( lhs, rhs ); |
91 |
– |
else unhandled->add( lhs, rhs ); |
92 |
– |
have_extras = 1; |
93 |
– |
} |
94 |
– |
|
95 |
– |
char* BondStamp::checkMe(){ |
96 |
– |
|
97 |
– |
if( !have_mbrs ){ |
98 |
– |
return strdup( "BondStamp error. Bond was not given members." ); |
99 |
– |
} |
100 |
– |
|
101 |
– |
return NULL; |
102 |
– |
} |