libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
|
The ISgfcPropertyFactory interface provides factory methods for creating ISgfcProperty objects, and objects of every known sub-type of ISgfcProperty. More...
#include <ISgfcPropertyFactory.h>
Public Member Functions | |
ISgfcPropertyFactory () | |
Initializes a newly constructed ISgfcPropertyFactory object. | |
virtual | ~ISgfcPropertyFactory () |
Destroys and cleans up the ISgfcPropertyFactory object. | |
virtual std::shared_ptr< ISgfcProperty > | CreateProperty (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< ISgfcProperty > | CreateProperty (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< ISgfcProperty > | CreateProperty (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< ISgfcProperty > | CreateProperty (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< ISgfcProperty > | CreateProperty (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< ISgfcProperty > | CreateProperty (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< ISgfcBoardSizeProperty > | CreateBoardSizeProperty () const =0 |
Returns a newly constructed ISgfcBoardSizeProperty object that has no value. The property is not associated with any node. | |
virtual std::shared_ptr< ISgfcBoardSizeProperty > | CreateBoardSizeProperty (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< ISgfcBoardSizeProperty > | CreateBoardSizeProperty (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< ISgfcGameTypeProperty > | CreateGameTypeProperty () const =0 |
Returns a newly constructed ISgfcGameTypeProperty object that has no value. The property is not associated with any node. | |
virtual std::shared_ptr< ISgfcGameTypeProperty > | CreateGameTypeProperty (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. | |
The ISgfcPropertyFactory interface provides factory methods for creating ISgfcProperty objects, and objects of every known sub-type of ISgfcProperty.
|
pure virtual |
Returns a newly constructed ISgfcBoardSizeProperty object that has no value. The property is not associated with any node.
Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.
|
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.
std::invalid_argument | Is thrown if propertyValue is nullptr, or if the propertyValue object is not composed of two ISgfcNumberPropertyValue objects. |
Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.
|
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.
std::invalid_argument | Is thrown if propertyValue is nullptr. |
Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.
|
pure virtual |
Returns a newly constructed ISgfcGameTypeProperty object that has no value. The property is not associated with any node.
Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.
|
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.
std::invalid_argument | Is thrown if propertyValue is nullptr. |
Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.
|
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.
|
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.
std::invalid_argument | Is 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.
|
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.
std::invalid_argument | Is 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.
|
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.
std::invalid_argument | Is thrown if propertyType is SgfcPropertyType::Unknown. |
Implemented in LibSgfcPlusPlus::SgfcPropertyFactory.
|
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.
std::invalid_argument | Is 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.
|
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.
std::invalid_argument | Is 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.