OpenLexocad  27.1
Core::PropertyGUID Class Reference

The PropertyGUID class saves and restores GUIDs. It also handles the management of GUIDs in the Document and makes sure that GUIDs are really unique within the Document and that the GUID corresponds to exactly one DocObject. More...

#include <PropertyGUID.h>

Inheritance diagram for Core::PropertyGUID:
Core::Property Base::Persistence Base::BaseClass

Public Member Functions

 PropertyGUID (void)
 
virtual ~PropertyGUID (void)
 
void setValue (const Base::GlobalId &id)
 
void setValue (const QUuid &id)
 
void setValue (const Base::String &base64)
 Set value from Base64 String. More...
 
void setValue (const char *aGuid)
 Set value from const char*. Expected format is '{A921A948-076F-4EAA-8203-DF69585D9491}'. More...
 
bool setValueFromVariant (const Core::Variant &value) override
 
void copyValue (Core::Property *p) override
 
Base::GlobalId createAndSetGUID ()
 Creates and a new GUID and sets the value. No notification or checking is done. More...
 
const Base::GlobalIdgetValue () const
 
Core::Variant getVariant (void) const override
 
unsigned int getData1 () const
 
unsigned short getData2 () const
 
unsigned short getData3 () const
 
void getData4 (unsigned char value[8]) const
 
virtual bool createSQL (Base::AbstractWriter &writer, Base::PersistenceVersion &save_version, bool data) override
 This method is used to save properties or very small amounts of data to an XML document. More...
 
virtual void save (Base::AbstractWriter &writer, Base::PersistenceVersion &save_version) override
 This method is used to save properties or very small amounts of data to an XML document. More...
 
virtual void restore (Base::AbstractXMLReader &reader, Base::PersistenceVersion &version) override
 This method is used to restore properties from an XML document. More...
 
virtual bool isEqual (const Property *) const override
 compare properties More...
 
virtual Core::Propertycopy (void) const override
 Returns a new copy of the property (mainly for Undo/Redo and transactions). The copy has no container. More...
 
virtual void paste (const Core::Property &from) override
 Paste the value from the property (mainly for Undo/Redo and transactions) More...
 
void toUuid (QUuid &uuid) const
 
Base::String toBase64String () const
 
Base::String toString () const
 
virtual std::shared_ptr< Core::DbgInfogetDbgInfo () const override
 Returns the debug information for this property. More...
 
- Public Member Functions inherited from Core::Property
 Property (void)
 
virtual ~Property (void)
 
void setName (const std::string &name)
 
std::string getName () const
 
Core::PropertyContainergetContainer () const
 
void setContainer (Core::PropertyContainer *container)
 
void addToContainer (const std::string &name)
 
virtual bool setKeyValue (const std::string &key, const Core::Variant &value)
 Sets a sub key in this property. More...
 
virtual std::map< std::string, Core::VariantgetKeyValueMap () const
 Returns all keys and their values of this property. More...
 
Core::Variant getVariantFromKey (const std::string &key) const
 Gets the variant for a key. More...
 
std::vector< std::string > getKeys () const
 Returns all keys of this property. More...
 
virtual void deepCopy (Core::Property *p, Core::CoreDocument *dest_doc, DocObjectMap &copyMap)
 
bool enableNotify (bool on)
 
bool isNotifyEnabled (void) const
 
void touch ()
 
bool setWillChangeStatusOnChange (bool on)
 
long getTransactionNumber () const
 
bool isUpdated () const
 Checks if the property was updated. More...
 
bool isTheOnlyUpdatedPropertyInContainer () const
 Checks if this is the only updated property in the container. More...
 
virtual const Core::PropertyKind getPropertyKind (void) const
 
virtual void setPropertyKind (Core::PropertyKind p)
 
bool hasValue () const
 Returns 'true' if the property has a value. This is mainly for optional properties. More...
 
virtual bool isOptional () const
 Checks if this is an optional property. More...
 
void setHasValue (bool yesno)
 is called when a property holds a value. For optional properties. More...
 
virtual bool isLink () const
 Check if Property is of type PropertyLink, LinkSet etc. For better performance. More...
 
void setStatus (const Property::Status &in)
 
Property::Status getStatus () const
 
bool isDefaultValue () const
 
void setDefaultValue (bool on)
 
void accept (Core::CoreVisitor *visitor)
 
short getType (void) const
 Get the type of the property in the container. More...
 
unsigned long getExStatus () const
 
bool testExStatus (ExStatus pos) const
 
void setExStatus (ExStatus pos, bool on)
 
void setExStatusValue (unsigned long status)
 
- Public Member Functions inherited from Base::Persistence
virtual void saveDocFile (Base::AbstractWriter &, const Base::String &, const Base::String &)
 This method is used to save large amounts of data to a binary file. More...
 
virtual void restoreDocFile (Base::Reader &, const Base::String &)
 This method is used to restore large amounts of data from a binary file. More...
 
virtual bool mustbeSaved () const
 Return 'true' if this object must always be saved in the file. More...
 
- Public Member Functions inherited from Base::BaseClass
virtual Type getTypeId (void) const
 
template<typename T >
bool isDerivedFrom () const
 
bool isDerivedFrom (const Type type) const
 
 BaseClass ()
 Construction. More...
 
virtual ~BaseClass ()
 Destruction. More...
 

Protected Member Functions

void check_and_save_or_throw (const Base::GlobalId &id)
 
- Protected Member Functions inherited from Core::Property
void hasSetValue (void)
 Should be called by all setValue() methods after the value was changed. More...
 
bool aboutToSetValue (const Core::Variant &newValue=Core::Variant())
 

Protected Attributes

Base::GlobalId _value
 
- Protected Attributes inherited from Core::Property
std::bitset< 32 > StatusBits
 

Additional Inherited Members

- Public Types inherited from Core::Property
enum  Status { New = 1 << 1, Valid = 1 << 2, Updated = 1 << 3 }
 
enum  ExStatus {
  Touched = 0, Immutable = 1, ReadOnly = 2, Hidden = 3,
  Transient = 4, MaterialEdit = 5, NoMaterialListEdit = 6, Output = 7,
  LockDynamic = 8, NoModify = 9, PartialTrigger = 10, NoRecompute = 11,
  Single = 12, Ordered = 13, EvalOnRestore = 14, PropStaticBegin = 21,
  PropDynamic = 21, PropNoPersist = 22, PropNoRecompute = 23, PropReadOnly = 24,
  PropTransient = 25, PropHidden = 26, PropOutput = 27, PropStaticEnd = 28,
  User1 = 28, User2 = 29, User3 = 30, User4 = 31
}
 
- Static Public Member Functions inherited from Core::Property
static void registerProperties (Base::Type t, const Core::PropertyValueMap &pvm)
 Registers the properties with default values for type 't'. More...
 
static bool getRegisteredProperties (Base::Type t, Core::PropertyValueMap &pvm)
 Returns the properties with default values of type t;. More...
 
static const char * getXMLPropertyAttributeName ()
 
static const char * getXMLPropertyAttributeValue ()
 
static void setXMLPropertyAttributeName (const char *)
 
static void setXMLPropertyAttributeValue (const char *)
 
- Static Public Member Functions inherited from Base::Persistence
static std::string encodeAttribute (const std::string &)
 
- Static Public Member Functions inherited from Base::BaseClass
static Type getClassTypeId (void)
 
static void init (void)
 
static void * create (void)
 
static void setIfcNameAndID (const std::string &n, int id)
 
- Public Attributes inherited from Base::BaseClass
long ____deadVal = 0xBADEAFFE
 
- Static Protected Member Functions inherited from Base::BaseClass
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=0)
 
static void initIfcTypes (const std::string &s, Base::Type classTypeId, int id)
 

Detailed Description

The PropertyGUID class saves and restores GUIDs. It also handles the management of GUIDs in the Document and makes sure that GUIDs are really unique within the Document and that the GUID corresponds to exactly one DocObject.

Since
24.0
Author
HPK
Date

Constructor & Destructor Documentation

◆ PropertyGUID()

Core::PropertyGUID::PropertyGUID ( void  )

◆ ~PropertyGUID()

virtual Core::PropertyGUID::~PropertyGUID ( void  )
virtual

Member Function Documentation

◆ check_and_save_or_throw()

void Core::PropertyGUID::check_and_save_or_throw ( const Base::GlobalId id)
protected

◆ copy()

virtual Core::Property* Core::PropertyGUID::copy ( void  ) const
overridevirtual

Returns a new copy of the property (mainly for Undo/Redo and transactions). The copy has no container.

Implements Core::Property.

◆ copyValue()

void Core::PropertyGUID::copyValue ( Core::Property p)
overridevirtual

Implements Core::Property.

◆ createAndSetGUID()

Base::GlobalId Core::PropertyGUID::createAndSetGUID ( )

Creates and a new GUID and sets the value. No notification or checking is done.

◆ createSQL()

virtual bool Core::PropertyGUID::createSQL ( Base::AbstractWriter ,
Base::PersistenceVersion ,
bool   
)
overridevirtual

This method is used to save properties or very small amounts of data to an XML document.

Reimplemented from Core::Property.

◆ getData1()

unsigned int Core::PropertyGUID::getData1 ( ) const

◆ getData2()

unsigned short Core::PropertyGUID::getData2 ( ) const

◆ getData3()

unsigned short Core::PropertyGUID::getData3 ( ) const

◆ getData4()

void Core::PropertyGUID::getData4 ( unsigned char  value[8]) const

◆ getDbgInfo()

virtual std::shared_ptr<Core::DbgInfo> Core::PropertyGUID::getDbgInfo ( ) const
overridevirtual

Returns the debug information for this property.

Reimplemented from Core::Property.

◆ getValue()

const Base::GlobalId& Core::PropertyGUID::getValue ( ) const

◆ getVariant()

Core::Variant Core::PropertyGUID::getVariant ( void  ) const
overridevirtual

Implements Core::Property.

◆ isEqual()

virtual bool Core::PropertyGUID::isEqual ( const Property ) const
overridevirtual

compare properties

Implements Core::Property.

◆ paste()

virtual void Core::PropertyGUID::paste ( const Core::Property from)
overridevirtual

Paste the value from the property (mainly for Undo/Redo and transactions)

Implements Core::Property.

◆ restore()

virtual void Core::PropertyGUID::restore ( Base::AbstractXMLReader ,
Base::PersistenceVersion  
)
overridevirtual

This method is used to restore properties from an XML document.

Implements Base::Persistence.

◆ save()

virtual void Core::PropertyGUID::save ( Base::AbstractWriter ,
Base::PersistenceVersion  
)
overridevirtual

This method is used to save properties or very small amounts of data to an XML document.

Implements Base::Persistence.

◆ setValue() [1/4]

void Core::PropertyGUID::setValue ( const Base::GlobalId id)

◆ setValue() [2/4]

void Core::PropertyGUID::setValue ( const QUuid &  id)

◆ setValue() [3/4]

void Core::PropertyGUID::setValue ( const Base::String base64)

Set value from Base64 String.

◆ setValue() [4/4]

void Core::PropertyGUID::setValue ( const char *  aGuid)

Set value from const char*. Expected format is '{A921A948-076F-4EAA-8203-DF69585D9491}'.

◆ setValueFromVariant()

bool Core::PropertyGUID::setValueFromVariant ( const Core::Variant value)
overridevirtual

Implements Core::Property.

◆ toBase64String()

Base::String Core::PropertyGUID::toBase64String ( ) const

◆ toString()

Base::String Core::PropertyGUID::toString ( ) const

◆ toUuid()

void Core::PropertyGUID::toUuid ( QUuid &  uuid) const

Member Data Documentation

◆ _value

Base::GlobalId Core::PropertyGUID::_value
protected

The documentation for this class was generated from the following file: