    

 ## On this page

  

 

 # ComputeSingleObjectPerObject&lt; TYPE &gt; Class Template Reference

 Last update: 16.07.2025 

a base class for algorithms that apply a simple algorithm to obtain a single object from another object [More...](class_compute_single_object_per_object.xhtml#details)

## <a name="pub-types"></a>Public Types

typedef boost::function&lt; DataObject::ptr\_type(DataObject::ptr\_type input)&gt; [TAlgorithmFunction](class_compute_single_object_per_object.xhtml#afe5cfc4ea6277ec393adca68465c9a5e) defines a function object [More...](#afe5cfc4ea6277ec393adca68465c9a5e)  
 typedef boost::function&lt; DataObject::ptr\_type([Structure](class_structure.xhtml) [database](group__data.xhtml#gaebcac3a2836ec9fdf2e47bd812994b6b), DataObject::ptr\_type input)&gt; [TAlgorithmFunction2](class_compute_single_object_per_object.xhtml#adbff8fbbd061127936232ab5600cbe01) defines a function object [More...](#adbff8fbbd061127936232ab5600cbe01)  
 ## <a name="pub-methods"></a>Public Member Functions

 [check](class_compute_single_object_per_object.xhtml#a47c34ec1e578c2ce27cf1c5fcd0d1704) ([Structure](class_structure.xhtml) [database](group__data.xhtml#gaebcac3a2836ec9fdf2e47bd812994b6b)) checks the settings on plausibility It throws an exception if there is a problem with the settings. Important: It tries to find out all problems with these settings and then exits the routine. [More...](#a47c34ec1e578c2ce27cf1c5fcd0d1704)  
  [compute](class_compute_single_object_per_object.xhtml#a2ee6c389c27f8cb563b6b1aa31f6bf17) ([Structure](class_structure.xhtml) [database](group__data.xhtml#gaebcac3a2836ec9fdf2e47bd812994b6b), DataObject::ptr\_type [data](class_compute_single_object_per_object.xhtml#aff21fffab499ea652443206d66e1a9bb), string new\_quantity\_ident, string new\_design\_ident) performs the action for a single set of samples [More...](#a2ee6c389c27f8cb563b6b1aa31f6bf17)  
  [compute](class_compute_single_object_per_object.xhtml#ab08e112d95fe611e7eb25491c354d115) ([Structure](class_structure.xhtml) [database](group__data.xhtml#gaebcac3a2836ec9fdf2e47bd812994b6b)) performs the action using the defined settings. [More...](#ab08e112d95fe611e7eb25491c354d115)  
  [ComputeSingleObjectPerObject](class_compute_single_object_per_object.xhtml#a432f44acdb38cd43ae8703c0686c0943) ([TAlgorithmFunction](class_compute_single_object_per_object.xhtml#afe5cfc4ea6277ec393adca68465c9a5e) function, [TAlgorithmFunction2](class_compute_single_object_per_object.xhtml#adbff8fbbd061127936232ab5600cbe01) function2, string op\_ident) constructor which assumes an empty selection It is mainly used to initialized the object and to provide a functional "compute()" method. [More...](#a432f44acdb38cd43ae8703c0686c0943)  
  [ComputeSingleObjectPerObject](class_compute_single_object_per_object.xhtml#a84c9f6ead5046474a0f7835eb67ef672) ([DataObjectContainer](class_data_object_container.xhtml) the\_data, [TAlgorithmFunction](class_compute_single_object_per_object.xhtml#afe5cfc4ea6277ec393adca68465c9a5e) function, [TAlgorithmFunction2](class_compute_single_object_per_object.xhtml#adbff8fbbd061127936232ab5600cbe01) function2, string op\_ident, string quantity\_modifier) constructor which sets suitable defaults for all members [More...](#a84c9f6ead5046474a0f7835eb67ef672)  
 ## <a name="pub-attribs"></a>Public Attributes

<a id="aff21fffab499ea652443206d66e1a9bb"></a>[DataObjectContainer](class_data_object_container.xhtml) [data](class_compute_single_object_per_object.xhtml#aff21fffab499ea652443206d66e1a9bb) the data set to be analyzed   
 <a id="a30b1bcf63b9bdc707fea30bd96d70447"></a>[DataObjectContainer::string\_vector\_type](class_data_object_container.xhtml#ac293ea0e5c280f69a497ea20f20c60b9) [new\_quantity\_idents](class_compute_single_object_per_object.xhtml#a30b1bcf63b9bdc707fea30bd96d70447) the new idents for each quantity. The dimension and index space must fit the one of *quantity\_idents*   
 <a id="ade25e60bd85c8b4abd4f5b416cae0eb9"></a>bool [overwrite\_existing](class_compute_single_object_per_object.xhtml#ade25e60bd85c8b4abd4f5b416cae0eb9) is true if already existing output data objects will be replaced. In this case, also all depending objects of the already existing one will be deleted.   
 <a id="aced57c746ae1d69d2fd56872fa1768bf"></a>[DataObjectContainer::string\_vector\_type](class_data_object_container.xhtml#ac293ea0e5c280f69a497ea20f20c60b9) [quantity\_idents](class_compute_single_object_per_object.xhtml#aced57c746ae1d69d2fd56872fa1768bf) the quantities to be analyzed. If a quantity ident does not exist in *data*, no error appears.   
 <a id="details" name="details"></a>## Detailed Description

### template&lt;dataobject\_types TYPE&gt;  
class ComputeSingleObjectPerObject&lt; TYPE &gt;

a base class for algorithms that apply a simple algorithm to obtain a single object from another object

Template Parameters TYPEthe field data type 

## Member Typedef Documentation

<a id="afe5cfc4ea6277ec393adca68465c9a5e"></a>## [◆ ](#afe5cfc4ea6277ec393adca68465c9a5e)TAlgorithmFunction

 typedef boost::function&lt;DataObject::ptr\_type ( DataObject::ptr\_type input)&gt; [TAlgorithmFunction](class_compute_single_object_per_object.xhtml#afe5cfc4ea6277ec393adca68465c9a5e)

defines a function object

Parameters inputa single input object Returnsthe result of the operation 



<a id="adbff8fbbd061127936232ab5600cbe01"></a>## [◆ ](#adbff8fbbd061127936232ab5600cbe01)TAlgorithmFunction2

 typedef boost::function&lt;DataObject::ptr\_type ( [Structure](class_structure.xhtml) [database](group__data.xhtml#gaebcac3a2836ec9fdf2e47bd812994b6b), DataObject::ptr\_type input)&gt; [TAlgorithmFunction2](class_compute_single_object_per_object.xhtml#adbff8fbbd061127936232ab5600cbe01)

defines a function object

Parameters databasethe database we refer to inputa single input object Returnsthe result of the operation 



## Constructor &amp; Destructor Documentation

<a id="a432f44acdb38cd43ae8703c0686c0943"></a>## [◆ ](#a432f44acdb38cd43ae8703c0686c0943)ComputeSingleObjectPerObject() \[1/2\]

 [ComputeSingleObjectPerObject](class_compute_single_object_per_object.xhtml)  ( [TAlgorithmFunction](class_compute_single_object_per_object.xhtml#afe5cfc4ea6277ec393adca68465c9a5e)  *function*,    [TAlgorithmFunction2](class_compute_single_object_per_object.xhtml#adbff8fbbd061127936232ab5600cbe01)  *function2*,    string  *op\_ident*   ) 

constructor which assumes an empty selection It is mainly used to initialized the object and to provide a functional "compute()" method.

Parameters functiondefines the function to be executed function2defines the function to be executed, if *function* is not initialized. op\_identthe ident of the operation (for messages) 



<a id="a84c9f6ead5046474a0f7835eb67ef672"></a>## [◆ ](#a84c9f6ead5046474a0f7835eb67ef672)ComputeSingleObjectPerObject() \[2/2\]

 [ComputeSingleObjectPerObject](class_compute_single_object_per_object.xhtml)  ( [DataObjectContainer](class_data_object_container.xhtml)  *the\_data*,    [TAlgorithmFunction](class_compute_single_object_per_object.xhtml#afe5cfc4ea6277ec393adca68465c9a5e)  *function*,    [TAlgorithmFunction2](class_compute_single_object_per_object.xhtml#adbff8fbbd061127936232ab5600cbe01)  *function2*,    string  *op\_ident*,    string  *quantity\_modifier*   ) 

constructor which sets suitable defaults for all members

Parameters the\_datathe subset of field data to be token as input. All quantity idents are extracted. Then for each quantity a new result object will be created. functiondefines the function to be executed function2defines the function to be executed, if *function* is not initialized. op\_identthe ident of the operation (for messages) quantity\_modifierif this string is not empty, then the new quantities will be named "quantity\_modifier\[old\_quantity\_ident\]", else they are equal (which is an error!) 



## Member Function Documentation

<a id="a47c34ec1e578c2ce27cf1c5fcd0d1704"></a>## [◆ ](#a47c34ec1e578c2ce27cf1c5fcd0d1704)check()

 check  ( [Structure](class_structure.xhtml)  *database*) 

checks the settings on plausibility It throws an exception if there is a problem with the settings. Important: It tries to find out all problems with these settings and then exits the routine.

Parameters databasethe SoS structure 



<a id="a2ee6c389c27f8cb563b6b1aa31f6bf17"></a>## [◆ ](#a2ee6c389c27f8cb563b6b1aa31f6bf17)compute() \[1/2\]

 compute  ( [Structure](class_structure.xhtml)  *database*,    DataObject::ptr\_type  *data*,    string  *new\_quantity\_ident*,    string  *new\_design\_ident*   ) 

performs the action for a single set of samples

Parameters databasethe output object is to be inserted in this object datathe input data object new\_quantity\_identthe quantity ident of the new object new\_design\_identthe design ident of the new object If the input object is active, then the output object will be active as well (or inactive, respectively). 



<a id="ab08e112d95fe611e7eb25491c354d115"></a>## [◆ ](#ab08e112d95fe611e7eb25491c354d115)compute() \[2/2\]

 compute  ( [Structure](class_structure.xhtml)  *database*) 

performs the action using the defined settings.

Parameters databasethe output object where new objects are added to