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

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

#include <SgfcPropertyListValueTypeDescriptor.h>

Inheritance diagram for LibSgfcPlusPlus::SgfcPropertyListValueTypeDescriptor:
LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor

Public Member Functions

 SgfcPropertyListValueTypeDescriptor (std::shared_ptr< ISgfcPropertyValueTypeDescriptor > descriptorElementValueType)
 Initializes a newly constructed SgfcPropertyListValueTypeDescriptor object.
 
virtual ~SgfcPropertyListValueTypeDescriptor ()
 Destroys and cleans up the SgfcPropertyListValueTypeDescriptor 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 SgfcPropertyListValueTypeDescriptorToListValueTypeDescriptor () const override
 Returns an SgfcPropertyElistValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::ListValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
virtual std::shared_ptr< ISgfcPropertyValueTypeDescriptorGetDescriptorElementValueType () const
 Returns an ISgfcPropertyValueTypeDescriptor object that describes 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 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 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 SgfcPropertyListValueTypeDescriptor class provides an implementation of the ISgfcPropertyValueTypeDescriptor interface. See the interface header file for documentation.

SgfcPropertyListValueTypeDescriptor expresses the fact that some SGF properties can have more than one value. GetDescriptorElementValueType() returns a descriptor for the list element value type.

Note
The descriptor must be either an SgfcPropertyBasicValueTypeDescriptor or an SgfcPropertyComposedValueTypeDescriptor object. In both cases the basic value types must not be SgfcPropertyValueType::None.
A list type property has at least one value. Properties which allow zero values are "elists".

Example: The "LB" property value is a list of composed Point/SimpleText elements. GetDescriptorElementValueType() in this case returns an SgfcPropertyComposedValueTypeDescriptor object, which in turn is composed of two descriptors of type SgfcPropertyBasicValueTypeDescriptor, the first having the basic value type SgfcPropertyValueType::Point and the second. having the basic value type SgfcPropertyValueType::SimpleText.

Constructor & Destructor Documentation

◆ SgfcPropertyListValueTypeDescriptor()

LibSgfcPlusPlus::SgfcPropertyListValueTypeDescriptor::SgfcPropertyListValueTypeDescriptor ( std::shared_ptr< ISgfcPropertyValueTypeDescriptor > descriptorElementValueType)

Initializes a newly constructed SgfcPropertyListValueTypeDescriptor object.

Exceptions
std::logic_errorIs thrown if the descriptor object is neither an SgfcPropertyBasicValueTypeDescriptor nor an SgfcPropertyComposedValueTypeDescriptor object, or if the basic value type is SgfcPropertyValueType::None.

Member Function Documentation

◆ GetDescriptorType()

SgfcPropertyValueTypeDescriptorType LibSgfcPlusPlus::SgfcPropertyListValueTypeDescriptor::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.

◆ ToListValueTypeDescriptor()

const SgfcPropertyListValueTypeDescriptor * LibSgfcPlusPlus::SgfcPropertyListValueTypeDescriptor::ToListValueTypeDescriptor ( ) const
overridevirtual

Returns an SgfcPropertyElistValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::ListValueType. 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: