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::ISgfcPropertyFactory Class Referenceabstract

The ISgfcPropertyFactory interface provides factory methods for creating ISgfcProperty objects, and objects of every known sub-type of ISgfcProperty. More...

#include <ISgfcPropertyFactory.h>

Inheritance diagram for LibSgfcPlusPlus::ISgfcPropertyFactory:
LibSgfcPlusPlus::SgfcPropertyFactory

Public Member Functions

 ISgfcPropertyFactory ()
 Initializes a newly constructed ISgfcPropertyFactory object.
 
virtual ~ISgfcPropertyFactory ()
 Destroys and cleans up the ISgfcPropertyFactory object.
 
virtual std::shared_ptr< ISgfcPropertyCreateProperty (SgfcPropertyType propertyType) const =0
 Returns a newly constructed ISgfcProperty object that has the specified property type propertyType. The property has no values. The property is not associated with any node.
 
virtual std::shared_ptr< ISgfcPropertyCreateProperty (SgfcPropertyType propertyType, std::shared_ptr< ISgfcPropertyValue > propertyValue) const =0
 Returns a newly constructed ISgfcProperty object that has the specified property type propertyType and the specified property value propertyValue. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue object propertyValue.
 
virtual std::shared_ptr< ISgfcPropertyCreateProperty (SgfcPropertyType propertyType, const std::vector< std::shared_ptr< ISgfcPropertyValue > > &propertyValues) const =0
 Returns a newly constructed ISgfcProperty object that has the specified property type propertyType and the specified property values propertyValues. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue objects in propertyValues.
 
virtual std::shared_ptr< ISgfcPropertyCreateProperty (const std::string &propertyName) const =0
 Returns a newly constructed ISgfcProperty object that has the specified property name propertyName. The property type is inferred from the property name. The property has no values. The property is not associated with any node.
 
virtual std::shared_ptr< ISgfcPropertyCreateProperty (const std::string &propertyName, std::shared_ptr< ISgfcPropertyValue > propertyValue) const =0
 Returns a newly constructed ISgfcProperty object that has the specified property name propertyName and the specified property value propertyValue. The property type is inferred from the property name. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue object propertyValue.
 
virtual std::shared_ptr< ISgfcPropertyCreateProperty (const std::string &propertyName, const std::vector< std::shared_ptr< ISgfcPropertyValue > > &propertyValues) const =0
 Returns a newly constructed ISgfcProperty object that has the specified property name propertyName and the specified property values propertyValues. The property type is inferred from the property name. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue objects in propertyValues.
 
virtual std::shared_ptr< ISgfcBoardSizePropertyCreateBoardSizeProperty () const =0
 Returns a newly constructed ISgfcBoardSizeProperty object that has no value. The property is not associated with any node.
 
virtual std::shared_ptr< ISgfcBoardSizePropertyCreateBoardSizeProperty (std::shared_ptr< ISgfcNumberPropertyValue > propertyValue) const =0
 Returns a newly constructed ISgfcBoardSizeProperty object that has the specified property value propertyValue. The property is not associated with any node. The ISgfcBoardSizeProperty object takes ownership of the ISgfcNumberPropertyValue object propertyValue.
 
virtual std::shared_ptr< ISgfcBoardSizePropertyCreateBoardSizeProperty (std::shared_ptr< ISgfcComposedPropertyValue > propertyValue) const =0
 Returns a newly constructed ISgfcBoardSizeProperty object that has the specified property value propertyValue. The property is not associated with any node. The ISgfcBoardSizeProperty object takes ownership of the ISgfcComposedPropertyValue object propertyValue.
 
virtual std::shared_ptr< ISgfcGameTypePropertyCreateGameTypeProperty () const =0
 Returns a newly constructed ISgfcGameTypeProperty object that has no value. The property is not associated with any node.
 
virtual std::shared_ptr< ISgfcGameTypePropertyCreateGameTypeProperty (std::shared_ptr< ISgfcNumberPropertyValue > propertyValue) const =0
 Returns a newly constructed ISgfcGameTypeProperty object that has the specified property value propertyValue. The property is not associated with any node. The ISgfcGameTypeProperty object takes ownership of the ISgfcNumberPropertyValue object propertyValue.
 

Detailed Description

The ISgfcPropertyFactory interface provides factory methods for creating ISgfcProperty objects, and objects of every known sub-type of ISgfcProperty.

Member Function Documentation

◆ CreateBoardSizeProperty() [1/3]

virtual std::shared_ptr< ISgfcBoardSizeProperty > LibSgfcPlusPlus::ISgfcPropertyFactory::CreateBoardSizeProperty ( ) const
pure virtual

Returns a newly constructed ISgfcBoardSizeProperty object that has no value. The property is not associated with any node.

Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.

◆ CreateBoardSizeProperty() [2/3]

virtual std::shared_ptr< ISgfcBoardSizeProperty > LibSgfcPlusPlus::ISgfcPropertyFactory::CreateBoardSizeProperty ( std::shared_ptr< ISgfcComposedPropertyValue > propertyValue) const
pure virtual

Returns a newly constructed ISgfcBoardSizeProperty object that has the specified property value propertyValue. The property is not associated with any node. The ISgfcBoardSizeProperty object takes ownership of the ISgfcComposedPropertyValue object propertyValue.

This overload constructs an ISgfcBoardSizeProperty object that describes a rectangular board.

Exceptions
std::invalid_argumentIs thrown if propertyValue is nullptr, or if the propertyValue object is not composed of two ISgfcNumberPropertyValue objects.

Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.

◆ CreateBoardSizeProperty() [3/3]

virtual std::shared_ptr< ISgfcBoardSizeProperty > LibSgfcPlusPlus::ISgfcPropertyFactory::CreateBoardSizeProperty ( std::shared_ptr< ISgfcNumberPropertyValue > propertyValue) const
pure virtual

Returns a newly constructed ISgfcBoardSizeProperty object that has the specified property value propertyValue. The property is not associated with any node. The ISgfcBoardSizeProperty object takes ownership of the ISgfcNumberPropertyValue object propertyValue.

This overload constructs an ISgfcBoardSizeProperty object that describes a square board.

Exceptions
std::invalid_argumentIs thrown if propertyValue is nullptr.

Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.

◆ CreateGameTypeProperty() [1/2]

virtual std::shared_ptr< ISgfcGameTypeProperty > LibSgfcPlusPlus::ISgfcPropertyFactory::CreateGameTypeProperty ( ) const
pure virtual

Returns a newly constructed ISgfcGameTypeProperty object that has no value. The property is not associated with any node.

Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.

◆ CreateGameTypeProperty() [2/2]

virtual std::shared_ptr< ISgfcGameTypeProperty > LibSgfcPlusPlus::ISgfcPropertyFactory::CreateGameTypeProperty ( std::shared_ptr< ISgfcNumberPropertyValue > propertyValue) const
pure virtual

Returns a newly constructed ISgfcGameTypeProperty object that has the specified property value propertyValue. The property is not associated with any node. The ISgfcGameTypeProperty object takes ownership of the ISgfcNumberPropertyValue object propertyValue.

Exceptions
std::invalid_argumentIs thrown if propertyValue is nullptr.

Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.

◆ CreateProperty() [1/6]

virtual std::shared_ptr< ISgfcProperty > LibSgfcPlusPlus::ISgfcPropertyFactory::CreateProperty ( const std::string & propertyName) const
pure virtual

Returns a newly constructed ISgfcProperty object that has the specified property name propertyName. The property type is inferred from the property name. The property has no values. The property is not associated with any node.

Attempts to map propertyName to a value in the enumeration SgfcPropertyType. If the mapping succeeds the result of invoking this method is the same as invoking the overload that takes an SgfcPropertyType value. If the mapping fails then the resulting ISgfcProperty object has SgfcPropertyType::Unknown.

If the mapped SgfcPropertyType value is SgfcPropertyType::SZ or SgfcPropertyType::GM, the returned ISgfcProperty object is an instance of ISgfcBoardSizeProperty or ISgfcGameTypeProperty.

Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.

◆ CreateProperty() [2/6]

virtual std::shared_ptr< ISgfcProperty > LibSgfcPlusPlus::ISgfcPropertyFactory::CreateProperty ( const std::string & propertyName,
const std::vector< std::shared_ptr< ISgfcPropertyValue > > & propertyValues ) const
pure virtual

Returns a newly constructed ISgfcProperty object that has the specified property name propertyName and the specified property values propertyValues. The property type is inferred from the property name. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue objects in propertyValues.

Attempts to map propertyName to a value in the enumeration SgfcPropertyType. If the mapping succeeds the result of invoking this method is the same as invoking the overload that takes an SgfcPropertyType value. If the mapping fails then the resulting ISgfcProperty object has SgfcPropertyType::Unknown.

If the mapped SgfcPropertyType value is SgfcPropertyType::SZ or SgfcPropertyType::GM, the returned ISgfcProperty object is an instance of ISgfcBoardSizeProperty or ISgfcGameTypeProperty.

Exceptions
std::invalid_argumentIs thrown if propertyValues contains a nullptr element, or if propertyValues contains duplicate elements. Is also thrown if the mapped SgfcPropertyType value is SgfcPropertyType::SZ or SgfcPropertyType::GM and propertyValues contains more than one value or the value does not meet the requirements of these property types. See the documentation of CreateBoardSizeProperty() or CreateGameTypeProperty() for details.

Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.

◆ CreateProperty() [3/6]

virtual std::shared_ptr< ISgfcProperty > LibSgfcPlusPlus::ISgfcPropertyFactory::CreateProperty ( const std::string & propertyName,
std::shared_ptr< ISgfcPropertyValue > propertyValue ) const
pure virtual

Returns a newly constructed ISgfcProperty object that has the specified property name propertyName and the specified property value propertyValue. The property type is inferred from the property name. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue object propertyValue.

Attempts to map propertyName to a value in the enumeration SgfcPropertyType. If the mapping succeeds the result of invoking this method is the same as invoking the overload that takes an SgfcPropertyType value. If the mapping fails then the resulting ISgfcProperty object has SgfcPropertyType::Unknown.

If the mapped SgfcPropertyType value is SgfcPropertyType::SZ or SgfcPropertyType::GM, the returned ISgfcProperty object is an instance of ISgfcBoardSizeProperty or ISgfcGameTypeProperty.

Exceptions
std::invalid_argumentIs thrown if propertyValue is nullptr. Is also thrown if the mapped SgfcPropertyType value is SgfcPropertyType::SZ or SgfcPropertyType::GM and propertyValue does not meet the requirements of these property types. See the documentation of CreateBoardSizeProperty() or CreateGameTypeProperty() for details.

Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.

◆ CreateProperty() [4/6]

virtual std::shared_ptr< ISgfcProperty > LibSgfcPlusPlus::ISgfcPropertyFactory::CreateProperty ( SgfcPropertyType propertyType) const
pure virtual

Returns a newly constructed ISgfcProperty object that has the specified property type propertyType. The property has no values. The property is not associated with any node.

If propertyType is SgfcPropertyType::SZ or SgfcPropertyType::GM, the returned ISgfcProperty object is an instance of ISgfcBoardSizeProperty or ISgfcGameTypeProperty.

Exceptions
std::invalid_argumentIs thrown if propertyType is SgfcPropertyType::Unknown.

Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.

◆ CreateProperty() [5/6]

virtual std::shared_ptr< ISgfcProperty > LibSgfcPlusPlus::ISgfcPropertyFactory::CreateProperty ( SgfcPropertyType propertyType,
const std::vector< std::shared_ptr< ISgfcPropertyValue > > & propertyValues ) const
pure virtual

Returns a newly constructed ISgfcProperty object that has the specified property type propertyType and the specified property values propertyValues. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue objects in propertyValues.

If propertyType is SgfcPropertyType::SZ or SgfcPropertyType::GM, the returned ISgfcProperty object is an instance of ISgfcBoardSizeProperty or ISgfcGameTypeProperty.

Exceptions
std::invalid_argumentIs thrown if propertyType is SgfcPropertyType::Unknown, or if propertyValues contains a nullptr element, or if propertyValues contains duplicate elements. Is also thrown if propertyType is SgfcPropertyType::SZ or SgfcPropertyType::GM and propertyValues contains more than one value or the value does not meet the requirements of these property types. See the documentation of CreateBoardSizeProperty() or CreateGameTypeProperty() for details.

Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.

◆ CreateProperty() [6/6]

virtual std::shared_ptr< ISgfcProperty > LibSgfcPlusPlus::ISgfcPropertyFactory::CreateProperty ( SgfcPropertyType propertyType,
std::shared_ptr< ISgfcPropertyValue > propertyValue ) const
pure virtual

Returns a newly constructed ISgfcProperty object that has the specified property type propertyType and the specified property value propertyValue. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue object propertyValue.

If propertyType is SgfcPropertyType::SZ or SgfcPropertyType::GM, the returned ISgfcProperty object is an instance of ISgfcBoardSizeProperty or ISgfcGameTypeProperty.

Exceptions
std::invalid_argumentIs thrown if propertyType is SgfcPropertyType::Unknown, or if propertyValue is nullptr. Is also thrown if propertyType is SgfcPropertyType::SZ or SgfcPropertyType::GM and propertyValue does not meet the requirements of these property types. See the documentation of CreateBoardSizeProperty() or CreateGameTypeProperty() for details.

Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.


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