Skip to main content
Part of Data Keeps track of all unique ValueTypes. Required to create new ValueType shared resource instances. Script example:

Get the ValueTypeManager associated with a database’s DataObjectContainer.

value_type_manager = sos.database().data().valueTypeManager()

Create a floating point ValueType, without any attributes

value_type = sos.ValueTypeDouble.create(value_type_manager, “my_unique_value_type”)
print(“Created ValueType:”) print(value_type)

Set attribute

value_type.setAttribute(“max”, 10)

Get Attribute

max = value_type.attribute(“max”) print(“Number of ValueTypes stored at ValueTypeManager:”) print(value_type_manager.size()) #1 value_type = None #Clear unreferenced ValueTypes value_type_manager.clearUnused() print(“Number of ValueTypes stored at ValueTypeManager:”) print(value_type_manager.size()) #0.

Public Member Functions

Detailed Description

Keeps track of all unique ValueTypes. Required to create new ValueType shared resource instances. Script example:

Get the ValueTypeManager associated with a database’s DataObjectContainer.

value_type_manager = sos.database().data().valueTypeManager()

Create a floating point ValueType, without any attributes

value_type = sos.ValueTypeDouble.create(value_type_manager, “my_unique_value_type”)
print(“Created ValueType:”) print(value_type)

Set attribute

value_type.setAttribute(“max”, 10)

Get Attribute

max = value_type.attribute(“max”) print(“Number of ValueTypes stored at ValueTypeManager:”) print(value_type_manager.size()) #1 value_type = None #Clear unreferenced ValueTypes value_type_manager.clearUnused() print(“Number of ValueTypes stored at ValueTypeManager:”) print(value_type_manager.size()) #0. output: Created ValueType: my_unique_value_type Number of ValueTypes stored at ValueTypeManager: 1 Number of ValueTypes stored at ValueTypeManager: 0

Constructor & Destructor Documentation

ValueTypeManager()

Default destructor. Copy constructor Parameters

Member Function Documentation

add()

Add a ValueType shared resource. If an equal ValueType instance (as determined by the == operator) already exists, the existing instance is returned. Exceptions

clearUnused()

Removes all unused ValueType instances. Returns Returns the number of ValueTypes removed.

operator=()

Assignment operator. Parameters Returns Assigned ValueTypeManager

size()

Get the number of unique ValueType instances. Returns number of unique value types.