libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor Class Referenceabstract

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>

Inheritance diagram for LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor:
LibSgfcPlusPlus::SgfcPropertyBasicValueTypeDescriptor LibSgfcPlusPlus::SgfcPropertyComposedValueTypeDescriptor LibSgfcPlusPlus::SgfcPropertyDualValueTypeDescriptor LibSgfcPlusPlus::SgfcPropertyElistValueTypeDescriptor LibSgfcPlusPlus::SgfcPropertyListValueTypeDescriptor

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 SgfcPropertyDualValueTypeDescriptorToDualValueTypeDescriptor () 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 SgfcPropertyElistValueTypeDescriptorToElistValueTypeDescriptor () 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 SgfcPropertyListValueTypeDescriptorToListValueTypeDescriptor () 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 SgfcPropertyComposedValueTypeDescriptorToComposedValueTypeDescriptor () 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 SgfcPropertyBasicValueTypeDescriptorToBasicValueTypeDescriptor () const
 Returns an SgfcPropertyBasicValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::BasicValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.
 

Detailed Description

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.

Member Function Documentation

◆ GetDescriptorType()

virtual SgfcPropertyValueTypeDescriptorType LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor::GetDescriptorType ( ) const
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.

◆ ToBasicValueTypeDescriptor()

const SgfcPropertyBasicValueTypeDescriptor * LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor::ToBasicValueTypeDescriptor ( ) const
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.

◆ ToComposedValueTypeDescriptor()

const SgfcPropertyComposedValueTypeDescriptor * LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor::ToComposedValueTypeDescriptor ( ) const
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.

◆ ToDualValueTypeDescriptor()

const SgfcPropertyDualValueTypeDescriptor * LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor::ToDualValueTypeDescriptor ( ) const
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.

◆ ToElistValueTypeDescriptor()

const SgfcPropertyElistValueTypeDescriptor * LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor::ToElistValueTypeDescriptor ( ) const
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.

◆ ToListValueTypeDescriptor()

const SgfcPropertyListValueTypeDescriptor * LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor::ToListValueTypeDescriptor ( ) const
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.


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