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::SgfcPropertyElistValueTypeDescriptor Class Reference

The SgfcPropertyElistValueTypeDescriptor class provides an implementation of the ISgfcPropertyValueTypeDescriptor interface. See the interface header file for documentation. More...

#include <SgfcPropertyElistValueTypeDescriptor.h>

Inheritance diagram for LibSgfcPlusPlus::SgfcPropertyElistValueTypeDescriptor:
LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor

Public Member Functions

 SgfcPropertyElistValueTypeDescriptor (std::shared_ptr< SgfcPropertyListValueTypeDescriptor > descriptorListValueType)
 Initializes a newly constructed SgfcPropertyElistValueTypeDescriptor object.
 
virtual ~SgfcPropertyElistValueTypeDescriptor ()
 Destroys and cleans up the SgfcPropertyElistValueTypeDescriptor 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 SgfcPropertyElistValueTypeDescriptorToElistValueTypeDescriptor () const override
 Returns an SgfcPropertyListValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::ElistValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
virtual std::shared_ptr< SgfcPropertyListValueTypeDescriptorGetDescriptorListValueType () const
 Returns an SgfcPropertyListValueTypeDescriptor object that is composed of another descriptor that defines the value type of the list elements.
 
- 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 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 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 SgfcPropertyElistValueTypeDescriptor class provides an implementation of the ISgfcPropertyValueTypeDescriptor interface. See the interface header file for documentation.

SgfcPropertyElistValueTypeDescriptor expresses the fact that for some properties the raw SGF property value can be either SgfcPropertyValueType::None or some other type. Which one needs to be determined by probing, i.e. by parsing the raw property value. GetDescriptorListValueType() always returns an SgfcPropertyListValueTypeDescriptor, which in turn is composed of another descriptor that defines the value type of the list elements.

Note
The SgfcPropertyListValueTypeDescriptor object must be composed of either an SgfcPropertyBasicValueTypeDescriptor or an SgfcPropertyComposedValueTypeDescriptor object.

SgfcPropertyElistValueTypeDescriptor could also be expressed with an SgfcPropertyDualValueTypeDescriptor. SgfcPropertyElistValueTypeDescriptor exists as a dedicated type only because the SGF standard explicitly names and describes "elist" in its EBNF definition section.

Example: The "DD" property value either is None, or it is a list of Point. GetDescriptorListValueType() in this case returns an SgfcPropertyListValueTypeDescriptor object, which in turn is composed of a descriptor of type SgfcPropertyBasicValueTypeDescriptor which has the basic value type SgfcPropertyValueType::Point.

Member Function Documentation

◆ GetDescriptorType()

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

◆ ToElistValueTypeDescriptor()

const SgfcPropertyElistValueTypeDescriptor * LibSgfcPlusPlus::SgfcPropertyElistValueTypeDescriptor::ToElistValueTypeDescriptor ( ) const
overridevirtual

Returns an SgfcPropertyListValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::ElistValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.

Reimplemented from LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor.


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