Unity Scopes API
ScopeBase.h File Reference
#include <unity/scopes/AbstractScopeBase.h>
#include <unity/scopes/ActionMetadata.h>
#include <unity/scopes/SearchMetadata.h>
#include <unity/scopes/Version.h>
Include dependency graph for ScopeBase.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  unity::scopes::ScopeBase
 Base class for a scope implementation. More...
 

Namespaces

 unity
 Top-level namespace for all things Unity-related.
 
 unity::scopes
 Top-level namespace for public functionality of the Unity scopes API.
 

Macros

#define UNITY_SCOPE_CREATE_FUNCTION
 Expands to the identifier of the scope create function.
 
#define UNITY_SCOPE_DESTROY_FUNCTION
 Expands to the identifier of the scope destroy function.
 
#define UNITY_SCOPE_CREATE_SYMSTR
 Expands to the identifier of the scope create function as a string literal.
 
#define UNITY_SCOPE_DESTROY_SYMSTR
 Expands to the identifier of the scope destroy function as a string literal.
 

Functions

unity::scopes::ScopeBaseUNITY_SCOPE_CREATE_FUNCTION ()
 The function called by the scopes run time to initialize the scope. It must return a pointer to an instance derived from ScopeBase. The returned instance must remain in scope until the destroy function is called by the scopes run time. More...
 
void UNITY_SCOPE_DESTROY_FUNCTION (unity::scopes::ScopeBase *p)
 The function called by the scopes run time to finalize the scope. The passed pointer is the pointer that was returned by the create function. More...
 

Variables

decltype(&UNITY_SCOPE_CREATE_FUNCTION) typedef unity::scopes::CreateFunction
 Convenience typedef for the create function pointer.
 
decltype(&UNITY_SCOPE_DESTROY_FUNCTION) typedef unity::scopes::DestroyFunction
 Convenience typedef for the destroy function pointer.
 

Function Documentation

unity::scopes::ScopeBase* UNITY_SCOPE_CREATE_FUNCTION ( )

The function called by the scopes run time to initialize the scope. It must return a pointer to an instance derived from ScopeBase. The returned instance must remain in scope until the destroy function is called by the scopes run time.

If this function throws an exception, the destroy function will not be called. If this function returns NULL, the destroy function will be called with NULL as its argument.

Note
The only purpose of the create function is to return the an instance. Do not do anything in the implementation that might block, and do not attempt to call any methods on ScopeBase from the constructor.
Returns
The pointer to the ScopeBase instance.
void UNITY_SCOPE_DESTROY_FUNCTION ( unity::scopes::ScopeBase p)

The function called by the scopes run time to finalize the scope. The passed pointer is the pointer that was returned by the create function.

Exceptions thrown by the destroy function are ignored.

Parameters
pThe pointer to the instance to be destroyed (previously returned by the create function).