Files
Clifford Yapp d824fc0c4e Keep longer directory names
We want to be consistent with the previous layout, to avoid needlessly
breaking existing codes.  The header update means client codes are not
required to include all of the stepcode library includes explicitly -
i.e., stepcode itself does not force this requirement with its own
internal includes.  However, if client codes do not want to add the
library prefixes to their own includes as we have for stepcode, they
should still be able to add the various includes and work as before.
Adjust the include directory names accordingly.
2022-10-02 17:57:57 -04:00

86 lines
2.0 KiB
C++

#ifndef UNIQUENESSRULE_H
#define UNIQUENESSRULE_H
#include "clstepcore/dictionaryInstance.h"
#include "clstepcore/sdai.h"
#include "sc_export.h"
class EntityDescriptor;
class SC_CORE_EXPORT Uniqueness_rule : public Dictionary_instance {
public:
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable: 4251 )
#endif
Express_id _label;
// non-SDAI
std::string _comment; /** Comment contained in the EXPRESS.
* Should be properly formatted to include (* *)
* Will be written to EXPRESS as-is (w/out formatting) */
#ifdef _MSC_VER
#pragma warning( pop )
#endif
const EntityDescriptor * _parent_entity;
Uniqueness_rule();
Uniqueness_rule( const Uniqueness_rule & );
Uniqueness_rule( const char * label, EntityDescriptor * pe = 0 )
: _label( label ), _parent_entity( pe ) { }
virtual ~Uniqueness_rule();
Express_id label_() const {
return _label;
}
const EntityDescriptor * parent_() const {
return _parent_entity;
}
std::string & comment_() {
return _comment;
}
void label_( const Express_id & ei ) {
_label = ei;
}
void parent_( const EntityDescriptor * pe ) {
_parent_entity = pe;
}
void comment_( const char * c ) {
_comment = c;
}
};
typedef Uniqueness_rule * Uniqueness_rule_ptr;
class SC_CORE_EXPORT Uniqueness_rule__set {
public:
Uniqueness_rule__set( int = 16 );
~Uniqueness_rule__set();
Uniqueness_rule_ptr & operator[]( int index );
void Insert( Uniqueness_rule_ptr, int index );
void Append( Uniqueness_rule_ptr );
void Remove( int index );
int Index( Uniqueness_rule_ptr );
int Count();
void Clear();
private:
void Check( int index );
private:
Uniqueness_rule_ptr * _buf;
int _bufsize;
int _count;
};
typedef Uniqueness_rule__set * Uniqueness_rule__set_ptr;
typedef Uniqueness_rule__set_ptr Uniqueness_rule__set_var;
#endif //UNIQUENESSRULE_H