-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathderivedAttribute.cc
More file actions
30 lines (26 loc) · 932 Bytes
/
derivedAttribute.cc
File metadata and controls
30 lines (26 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "derivedAttribute.h"
Derived_attribute::Derived_attribute( const char * name, const TypeDescriptor * domainType,
Logical optional, Logical unique, AttrType_Enum at, const EntityDescriptor & owner )
: AttrDescriptor( name, domainType, optional, unique, at, owner ) {
_initializer = ( const char * )0;
}
Derived_attribute::~Derived_attribute() {
}
const char * Derived_attribute::AttrExprDefStr( std::string & s ) const {
std::string buf;
s.clear();
if( Name() && strchr( Name(), '.' ) ) {
s = "SELF\\";
}
s.append( Name() );
s.append( " : " );
if( DomainType() ) {
DomainType()->AttrTypeName( buf );
s.append( buf );
}
if( _initializer ) { // this is supposed to exist for a derived attribute.
s.append( " \n\t\t:= " );
s.append( _initializer );
}
return const_cast<char *>( s.c_str() );
}