## BeginEvaluate

### Description

This optional callback is called during a single-threaded phase where memory is usually allocated in preparation for the multi-threaded evaluation phase. For example, we can use this callback to attach some pre-thread data to a node. The BeginEvaluate callback uses the ICENodeContext object to store the user data allocated.

Warning | The input and output ports cannot be accessed through the ICENodeContext object in this callback, except when the node is set as an element generator and then only input ports are available. The Evaluate callback can access both input and output port information.

Note | The user data stored in BeginEvaluate or Init is always accessible from the Evaluate callback. However, unless the custom node threading mode is single-threading, the Context::PutUserData property cannot be used from the Evaluate callback.

### Applies To

Custom ICENodes

### Syntax

    CStatus <icenode_name>_BeginEvaluate( CRef& in_context )
    {
            ...
    }

<icenode_name> is the name specified in the call to PluginRegistrar::RegisterICENode, with any spaces converted to underscores.

### Parameters

Parameter | Language | Type | Description
--- | --- | --- | ---
in_context | C++ | CRef& | A reference to the ICENodeContext object. Context::GetSource returns the ICENode.

### See Also

- EndEvaluate
- Evaluate
- Init (ICE Nodes)
- SubmitEvaluationPhaseInfo
- ICE Node Callbacks