Lean  $LEAN_TAG$
QuantConnect.Util.ObjectActivator Class Reference

Provides methods for creating new instances of objects More...

Static Public Member Functions

static Func< object[], object > GetActivator (Type dataType)
 Fast Object Creator from Generic Type: Modified from http://rogeralsing.com/2008/02/28/linq-expressions-creating-objects/ More...
 
static object Clone (object instanceToClone)
 Clones the specified instance using reflection More...
 
static T Clone< T > (T instanceToClone)
 Clones the specified instance and then casts it to T before returning More...
 
static void AddActivator (Type key, Func< object[], object > value)
 Adds method to return an instance of object More...
 
static void ResetActivators ()
 Reset the object activators More...
 

Detailed Description

Provides methods for creating new instances of objects

Definition at line 29 of file ObjectActivator.cs.

Member Function Documentation

◆ GetActivator()

static Func<object[], object> QuantConnect.Util.ObjectActivator.GetActivator ( Type  dataType)
static

Fast Object Creator from Generic Type: Modified from http://rogeralsing.com/2008/02/28/linq-expressions-creating-objects/

This assumes that the type has a parameterless, default constructor

Parameters
dataTypeType of the object we wish to create
Returns
Method to return an instance of object

Definition at line 49 of file ObjectActivator.cs.

Here is the caller graph for this function:

◆ Clone()

static object QuantConnect.Util.ObjectActivator.Clone ( object  instanceToClone)
static

Clones the specified instance using reflection

Parameters
instanceToCloneThe instance to be cloned
Returns
A field/property wise, non-recursive clone of the instance

Definition at line 96 of file ObjectActivator.cs.

Here is the caller graph for this function:

◆ Clone< T >()

static T QuantConnect.Util.ObjectActivator.Clone< T > ( instanceToClone)
static

Clones the specified instance and then casts it to T before returning

Type Constraints
T :class 

Definition at line 116 of file ObjectActivator.cs.

Here is the call graph for this function:

◆ AddActivator()

static void QuantConnect.Util.ObjectActivator.AddActivator ( Type  key,
Func< object[], object >  value 
)
static

Adds method to return an instance of object

Parameters
keyThe key of the method to add
valueThe value of the method to add

Definition at line 131 of file ObjectActivator.cs.

Here is the caller graph for this function:

◆ ResetActivators()

static void QuantConnect.Util.ObjectActivator.ResetActivators ( )
static

Reset the object activators

Definition at line 146 of file ObjectActivator.cs.


The documentation for this class was generated from the following file: