libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
|
The SgfcPropertyDualValueTypeDescriptor class provides an implementation of the ISgfcPropertyValueTypeDescriptor interface. See the interface header file for documentation. More...
#include <SgfcPropertyDualValueTypeDescriptor.h>
Public Member Functions | |
SgfcPropertyDualValueTypeDescriptor (std::shared_ptr< ISgfcPropertyValueTypeDescriptor > descriptorValueType1, std::shared_ptr< ISgfcPropertyValueTypeDescriptor > descriptorValueType2) | |
Initializes a newly constructed SgfcPropertyDualValueTypeDescriptor object. | |
virtual | ~SgfcPropertyDualValueTypeDescriptor () |
Destroys and cleans up the SgfcPropertyDualValueTypeDescriptor object. | |
virtual SgfcPropertyValueTypeDescriptorType | GetDescriptorType () const override |
Returns the concrete type of the descriptor object. Depending on the value returned, a caller then knows which one of the convenience casting methods to use. | |
virtual const SgfcPropertyDualValueTypeDescriptor * | ToDualValueTypeDescriptor () const override |
Returns an SgfcPropertyDualValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::DualValueType. Returns nullptr otherwise. The caller is not the owner of the returned object. | |
virtual std::shared_ptr< ISgfcPropertyValueTypeDescriptor > | GetDescriptorValueType1 () const |
Returns an ISgfcPropertyValueTypeDescriptor object that describes the first of the two possible value types. | |
virtual std::shared_ptr< ISgfcPropertyValueTypeDescriptor > | GetDescriptorValueType2 () const |
Returns an ISgfcPropertyValueTypeDescriptor object that describes the second of the two possible value types. | |
Public Member Functions inherited from LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor | |
ISgfcPropertyValueTypeDescriptor () | |
Initializes a newly constructed ISgfcPropertyValueTypeDescriptor object. | |
virtual | ~ISgfcPropertyValueTypeDescriptor () |
Destroys and cleans up the ISgfcPropertyValueTypeDescriptor object. | |
virtual const SgfcPropertyElistValueTypeDescriptor * | ToElistValueTypeDescriptor () const |
Returns an SgfcPropertyListValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::ElistValueType. Returns nullptr otherwise. The caller is not the owner of the returned object. | |
virtual const SgfcPropertyListValueTypeDescriptor * | ToListValueTypeDescriptor () const |
Returns an SgfcPropertyElistValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::ListValueType. Returns nullptr otherwise. The caller is not the owner of the returned object. | |
virtual const SgfcPropertyComposedValueTypeDescriptor * | ToComposedValueTypeDescriptor () const |
Returns an SgfcPropertyComposedValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::ComposedValueType. Returns nullptr otherwise. The caller is not the owner of the returned object. | |
virtual const SgfcPropertyBasicValueTypeDescriptor * | ToBasicValueTypeDescriptor () const |
Returns an SgfcPropertyBasicValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::BasicValueType. Returns nullptr otherwise. The caller is not the owner of the returned object. | |
The SgfcPropertyDualValueTypeDescriptor class provides an implementation of the ISgfcPropertyValueTypeDescriptor interface. See the interface header file for documentation.
SgfcPropertyDualValueTypeDescriptor expresses the fact that for some properties the raw SGF property value can be either of a first type, or a second type. Which one needs to be determined by probing, i.e. by parsing the raw property value. GetDescriptorValueType1() returns a descriptor for the first possible value type, GetDescriptorValueType2() returns a descriptor for the second possible value type.
Example: The "SZ" property value either is a single number, or it is a composed Number/Number. GetDescriptorValueType1() in this case returns an SgfcPropertyBasicValueTypeDescriptor object which has the basic value type SgfcPropertyValueType::Number. GetDescriptorValueType2() returns an SgfcPropertyComposedValueTypeDescriptor object, which in turn is composed of two descriptors of type SgfcPropertyBasicValueTypeDescriptor, both of which have the basic value type SgfcPropertyValueType::Number.
LibSgfcPlusPlus::SgfcPropertyDualValueTypeDescriptor::SgfcPropertyDualValueTypeDescriptor | ( | std::shared_ptr< ISgfcPropertyValueTypeDescriptor > | descriptorValueType1, |
std::shared_ptr< ISgfcPropertyValueTypeDescriptor > | descriptorValueType2 ) |
Initializes a newly constructed SgfcPropertyDualValueTypeDescriptor object.
std::logic_error | Is thrown if one or both of the two descriptor objects are neither SgfcPropertyBasicValueTypeDescriptor nor SgfcPropertyComposedValueTypeDescriptor objects. |
|
overridevirtual |
Returns the concrete type of the descriptor object. Depending on the value returned, a caller then knows which one of the convenience casting methods to use.
Implements LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor.
|
overridevirtual |
Returns an SgfcPropertyDualValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::DualValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.
Reimplemented from LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor.