    

 ## On this page

  

 

 # ValueTypeManager Class Reference

 Last update: 16.07.2025 

Keeps track of all unique ValueTypes. Required to create new [ValueType](class_value_type.xhtml "Represents a type of value and a set of properties. ValueType is intended to be associated with a set...") shared resource instances. Script example:

# Get the [ValueTypeManager](class_value_type_manager.xhtml "Keeps track of all unique ValueTypes. Required to create new ValueType shared resource instances...") associated with a database's [DataObjectContainer](class_data_object_container.xhtml "A general container for vector data. ").

value_type_manager = sos.database().data().valueTypeManager() # Create a floating point [ValueType](class_value_type.xhtml "Represents a type of value and a set of properties. ValueType is intended to be associated with a set..."), 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. [More...](class_value_type_manager.xhtml#details)## <a name="pub-methods"></a>Public Member Functions

std::shared\_ptr&lt; [ValueType](class_value_type.xhtml) &gt; [add](class_value_type_manager.xhtml#ad5980bb9b90886f3eb9f1bd3c6bf8c91) (std::shared\_ptr&lt; [ValueType](class_value_type.xhtml) &gt; value\_type) Add a [ValueType](class_value_type.xhtml "Represents a type of value and a set of properties. ValueType is intended to be associated with a set...") shared resource. If an equal [ValueType](class_value_type.xhtml "Represents a type of value and a set of properties. ValueType is intended to be associated with a set...") instance (as determined by the == operator) already exists, the existing instance is returned. [More...](#ad5980bb9b90886f3eb9f1bd3c6bf8c91)  
 size\_t [clearUnused](class_value_type_manager.xhtml#a89c4dbac8bd1b1451d695ca81fbd3d64) () Removes all unused [ValueType](class_value_type.xhtml "Represents a type of value and a set of properties. ValueType is intended to be associated with a set...") instances. [More...](#a89c4dbac8bd1b1451d695ca81fbd3d64)  
 [ValueTypeManager](class_value_type_manager.xhtml) [operator=](class_value_type_manager.xhtml#a60dc6bfde52dbe186fcd5b03ee9c8987) ([ValueTypeManager](class_value_type_manager.xhtml) manager) Assignment operator. [More...](#a60dc6bfde52dbe186fcd5b03ee9c8987)  
 size\_t [size](class_value_type_manager.xhtml#a0b6b70701c46e22849f0f363861351cd) () Get the number of unique [ValueType](class_value_type.xhtml "Represents a type of value and a set of properties. ValueType is intended to be associated with a set...") instances. [More...](#a0b6b70701c46e22849f0f363861351cd)  
 <a id="a77088d3cfe0f24c2d195fc42732811f1"></a> [ValueTypeManager](class_value_type_manager.xhtml#a77088d3cfe0f24c2d195fc42732811f1) () Default constructor.   
  [ValueTypeManager](class_value_type_manager.xhtml#a5ed7064a8346fe206c12cfd8107158e3) ([ValueTypeManager](class_value_type_manager.xhtml) manager) Default destructor. [More...](#a5ed7064a8346fe206c12cfd8107158e3)  
 <a id="details" name="details"></a>## Detailed Description

Keeps track of all unique ValueTypes. Required to create new [ValueType](class_value_type.xhtml "Represents a type of value and a set of properties. ValueType is intended to be associated with a set...") shared resource instances. Script example:

# Get the [ValueTypeManager](class_value_type_manager.xhtml "Keeps track of all unique ValueTypes. Required to create new ValueType shared resource instances...") associated with a database's [DataObjectContainer](class_data_object_container.xhtml "A general container for vector data. ").

value\_type\_manager = sos.database().data().valueTypeManager()

# Create a floating point [ValueType](class_value_type.xhtml "Represents a type of value and a set of properties. ValueType is intended to be associated with a set..."), 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](class_value_type.xhtml "Represents a type of value and a set of properties. ValueType is intended to be associated with a set..."): my\_unique\_value\_type Number of ValueTypes stored at [ValueTypeManager](class_value_type_manager.xhtml "Keeps track of all unique ValueTypes. Required to create new ValueType shared resource instances..."): 1 Number of ValueTypes stored at [ValueTypeManager](class_value_type_manager.xhtml "Keeps track of all unique ValueTypes. Required to create new ValueType shared resource instances..."): 0



## Constructor &amp; Destructor Documentation

<a id="a5ed7064a8346fe206c12cfd8107158e3"></a>## [◆ ](#a5ed7064a8346fe206c12cfd8107158e3)ValueTypeManager()

 [ValueTypeManager](class_value_type_manager.xhtml)  ( [ValueTypeManager](class_value_type_manager.xhtml)  *manager*) 

Default destructor.

Copy constructor

Parameters managerobject to be copied. 



## Member Function Documentation

<a id="ad5980bb9b90886f3eb9f1bd3c6bf8c91"></a>## [◆ ](#ad5980bb9b90886f3eb9f1bd3c6bf8c91)add()

 std::shared\_ptr&lt;[ValueType](class_value_type.xhtml)&gt; add  ( std::shared\_ptr&lt; [ValueType](class_value_type.xhtml) &gt;  *value\_type*) 

Add a [ValueType](class_value_type.xhtml "Represents a type of value and a set of properties. ValueType is intended to be associated with a set...") shared resource. If an equal [ValueType](class_value_type.xhtml "Represents a type of value and a set of properties. ValueType is intended to be associated with a set...") instance (as determined by the == operator) already exists, the existing instance is returned.

Exceptions Ifa different [ValueType](class_value_type.xhtml "Represents a type of value and a set of properties. ValueType is intended to be associated with a set...") with equal name already exists. 



<a id="a89c4dbac8bd1b1451d695ca81fbd3d64"></a>## [◆ ](#a89c4dbac8bd1b1451d695ca81fbd3d64)clearUnused()

 size\_t clearUnused  ( ) 

Removes all unused [ValueType](class_value_type.xhtml "Represents a type of value and a set of properties. ValueType is intended to be associated with a set...") instances.

ReturnsReturns the number of ValueTypes removed. 



<a id="a60dc6bfde52dbe186fcd5b03ee9c8987"></a>## [◆ ](#a60dc6bfde52dbe186fcd5b03ee9c8987)operator=()

 [ValueTypeManager](class_value_type_manager.xhtml) operator=  ( [ValueTypeManager](class_value_type_manager.xhtml)  *manager*) 

Assignment operator.

Parameters managerobject to be assigned ReturnsAssigned [ValueTypeManager](class_value_type_manager.xhtml "Keeps track of all unique ValueTypes. Required to create new ValueType shared resource instances...") 



<a id="a0b6b70701c46e22849f0f363861351cd"></a>## [◆ ](#a0b6b70701c46e22849f0f363861351cd)size()

 size\_t size  ( ) 

Get the number of unique [ValueType](class_value_type.xhtml "Represents a type of value and a set of properties. ValueType is intended to be associated with a set...") instances.

Returnsnumber of unique value types.