libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
|
The ISgfcPropertyValueTypeDescriptor interface provides a description of the potential types of values that a specific SGF property can have in the raw SGF content. This information helps with parsing the raw SGF property value string. More...
#include <ISgfcPropertyValueTypeDescriptor.h>
Public Member Functions | |
ISgfcPropertyValueTypeDescriptor () | |
Initializes a newly constructed ISgfcPropertyValueTypeDescriptor object. | |
virtual | ~ISgfcPropertyValueTypeDescriptor () |
Destroys and cleans up the ISgfcPropertyValueTypeDescriptor object. | |
virtual SgfcPropertyValueTypeDescriptorType | GetDescriptorType () const =0 |
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 |
Returns an SgfcPropertyDualValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::DualValueType. Returns nullptr otherwise. The caller is not the owner of the returned 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 ISgfcPropertyValueTypeDescriptor interface provides a description of the potential types of values that a specific SGF property can have in the raw SGF content. This information helps with parsing the raw SGF property value string.
ISgfcPropertyValueTypeDescriptor contains a number of convenience methods that help casting an ISgfcPropertyValueTypeDescriptor object to a concrete type (e.g. ToDualValueTypeDescriptor()). The return value of GetDescriptorType() provides the information which casting method to use.
With the exception of SgfcPropertyBasicValueTypeDescriptor, all implementations of ISgfcPropertyValueTypeDescriptor are composed of one or more other ISgfcPropertyValueTypeDescriptor objects. The goal is that the descriptor for a specific property can ultimately be broken down into one or more SgfcPropertyBasicValueTypeDescriptor.
In theory the concept allows arbitrary nesting of descriptors. In practice the nesting is restricted by the current implementation of the decoder that parses property values. The restrictions are these:
The decoder implementation (and therefore the restrictions it imposes) are geared towards what is possible according to the definitions in the SGF standard. If a future version of the SGF standard allows more complex descriptor combinations, the decoder implementation will have to be expanded.
Example: The "AR" property contains a list of composed Point/Point values. The top-level descriptor for the property therefore is an SgfcPropertyListValueTypeDescriptor object, which is composed of another descriptor of type SgfcPropertyComposedValueTypeDescriptor, which in turn is composed of two descriptors of type SgfcPropertyBasicValueTypeDescriptor, both of which have the basic value type SgfcPropertyValueType::Number.
ISgfcPropertyValueTypeDescriptor is immutable, i.e. once the ISgfcPropertyValueTypeDescriptor object is constructed it cannot be changed.
|
pure virtual |
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.
Implemented in LibSgfcPlusPlus::SgfcPropertyBasicValueTypeDescriptor, LibSgfcPlusPlus::SgfcPropertyComposedValueTypeDescriptor, LibSgfcPlusPlus::SgfcPropertyDualValueTypeDescriptor, LibSgfcPlusPlus::SgfcPropertyElistValueTypeDescriptor, and LibSgfcPlusPlus::SgfcPropertyListValueTypeDescriptor.
|
virtual |
Returns an SgfcPropertyBasicValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::BasicValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.
Reimplemented in LibSgfcPlusPlus::SgfcPropertyBasicValueTypeDescriptor.
|
virtual |
Returns an SgfcPropertyComposedValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::ComposedValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.
Reimplemented in LibSgfcPlusPlus::SgfcPropertyComposedValueTypeDescriptor.
|
virtual |
Returns an SgfcPropertyDualValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::DualValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.
Reimplemented in LibSgfcPlusPlus::SgfcPropertyDualValueTypeDescriptor.
|
virtual |
Returns an SgfcPropertyListValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::ElistValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.
Reimplemented in LibSgfcPlusPlus::SgfcPropertyElistValueTypeDescriptor.
|
virtual |
Returns an SgfcPropertyElistValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::ListValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.
Reimplemented in LibSgfcPlusPlus::SgfcPropertyListValueTypeDescriptor.