public VariableReader(VariableMetaData variableMetaData, VariableVersionThreadLocal versionThreadLocal, VersionedValueList <Object> versionsLow) { _variableMetaData = variableMetaData; _versionThreadLocal = versionThreadLocal; _versionsLow = versionsLow; _versionsHigh = null; }
/// <summary> /// Ctor. /// </summary> /// <param name="container">The container.</param> /// <param name="startVersion">the first version number to start from</param> /// <param name="millisecondLifetimeOldVersions">number of milliseconds a version may hang around before expiry</param> /// <param name="timeProvider">provides the current time</param> /// <param name="eventAdapterService">for finding event types</param> /// <param name="optionalStateHandler">a optional plug-in that may store variable state and retrieve state upon creation</param> public VariableServiceImpl( IContainer container, int startVersion, long millisecondLifetimeOldVersions, TimeProvider timeProvider, EventAdapterService eventAdapterService, VariableStateHandler optionalStateHandler) { _versionThreadLocal = new VariableVersionThreadLocal(container.ThreadLocalManager()); _millisecondLifetimeOldVersions = millisecondLifetimeOldVersions; _timeProvider = timeProvider; _eventAdapterService = eventAdapterService; _optionalStateHandler = optionalStateHandler; _variables = new Dictionary <String, VariableMetaData>().WithNullSupport(); _readWriteLock = container.RWLockManager().CreateLock(MethodBase.GetCurrentMethod().DeclaringType); _variableVersionsPerCP = new List <ConcurrentDictionary <int, VariableReader> >(); _changeCallbacksPerCP = new List <IDictionary <int, ICollection <VariableChangeCallback> > >(); _currentVersionNumber = startVersion; }
public void Dispose() { _versionThreadLocal = new VariableVersionThreadLocal(); }