NFX NamespaceNFX Class Library

[This is preliminary documentation and is subject to change.]

Root namespace for NFX framework, contains some commonly-used classes
Classes

  ClassDescription
Public classAbsentValue
Represents a special value that signifies the absence of any entity/state/value/data. The instances may be stored in a cache to indicate that the key exists, but points to a non-existing "absent" entity. This is usefull for DB lookups, not to touch the backend for values that dont exist. Use AbsentValue.Instance singleton
Public classApp
Provides a shortcut access to app-global context NFX.ApplicationModel.ExecutionContext.Application.*
Public classAver
Provides basic averments for test construction. May call Aver.Fail(msg) manually
Public classAvermentException
Thrown by Aver class to indicate averment failures
Public classCollectionUtils
Some helpful extensions for standard collections
Public classCoreConsts
Central non-lozalizable NFX system consts
Public classDataUtils
Public classDebug
Facilitates debugging tasks enabled by DEBUG conditional define
Public classDebugAssertionException
Thrown by Debug class to indicate assertion failures
Public classDebugging
Facilitates debugging tasks that do not depend on any conditional defines
Public classDisposableObject
General-purpose base class for objects that need to be disposed
Public classDisposedObjectException
This exception is thrown from DisposableObject.EnsureObjectNotDisposed() method
Public classELink
Represents an Electronic Link which is an alpha-encoded identifier along with metadata information. Warning! This class MAY generate fragments of profanity, however any ID can be regenerated using a different seed passed to Encode(seed)
Public classEmbeddedResource
Fetches resources such as script statement text by scriptName from assembly resource stream. Mostly used for SQL and JavaScript but maybe used for any text retrieval. This class is 100% safe for multithreading operations. Script texts are cached in ram for faster subsequent access.
Public classExternalParameterAttribute
Decorates properties that may be used as bindable external parameters. Provides methods for extraction of parameter names, values and binding of external object values into public read/write properties decorated by this attribute
Public classExternalRandomGenerator
Represents a random generator which is based on System.Random() yet has an ability to feed external samples into it. Use ExtrenalRandomGenerator.Instance to use the default thread-safe instance.
Public classIntMath
Public classIOMiscUtils
Misc utils for I/O
Public classMiscUtils
Public classNFXException
Base exception thrown by the framework
Public classObjectValueConversion
Provides extension methods for converting object values to different scalar types
Public classOrderedRegistry T 
Represents a thread-safe registry of T which is ordered by Order property. This class is efficient for concurrent read access and is not designed for cases when frequent modifications happen. It is ideal for lookup of named instances that have much longer time span than components that look them up. Note: since registry does reading in a lock-free manner, it is possible to have an inconsistent read snapshot of ordered items which may capture items that have already/not yet been added to the registry
Public classReferenceEqualityComparer T 
Checks for reference equality. Use ReferenceEqualityComparer(T).Instance
Public classRegistry T 
Represents a thread-safe registry of T. This class is efficient for concurrent read access and is not designed for cases when frequent modifications happen. It is ideal for lookup of named instances (such as components) that have much longer time span than components that look them up. Registry performs lock-free lookup which speeds-up many concurrent operations that need to map names into objects. The enumeration over registry makes a snapshot of its data, hence a registry may be modified by other threads while being enumerated.
Protected classRegistryDictionary T 
Internal dictionary of string-named objects
Public classScope
Helper class to be used in the context of 'using' clause to facilitate cleanup on scope exit and performing of other functions such as status logging
Public classSealedString Scope
Represents a scope of a SealedString creation that tracks the existing strings. Use Seal(string) to get an existing string or create a new one. Do not persist the instance of Scope for a long time as it accumulates references (string keys) that pressure the GC. This class is used in batched that create many sealed strings. Once those strings rae created the scope can be released.
Protected classStringConsts
A dictionary of framework text messages. Localization may be done in this class in future
Public classStringValueConversion
Provides extension methods for converting string values to different scalar types
Public classTaskUtils
Public classTrace
Facilitates debugging tasks enabled by TRACE conditional define
Public classURIUtils
Public classWrappedException
Represents exception that contains data about causing exception with all of it's chain
Public classWrappedExceptionData
Marshalls exception details
Structures

  StructureDescription
Public structureFID
Represents an ultra-efficient 64 bit in-process-wide unique identifier "Fast Id". The ID is going to wrap-around after at least 2 weeks (19 days). The ID consists of 3 segments: [timestamp: 24bit][threadseed: 24bit][counter: 16 bit]. This is needed because: a). FID stays unique after process restarts b). This design does not use interlock on global seed, but uses thread-static vars which is 10-20 times faster The timestamp is the number of 100ms intervals elapsed since Jan 1 2015 expressed as a 24 bit unsigned int, which gives 2^24 = 16,777,216 combinations which covers 19 days (around 2 weeks) at 100 msec resolution, consequently the ID will generate duplicates after this period. This struct is useful for creating unique IDs for protocol/traffic messages that live for a limited time (no more than 2 weeks). Caution: This ID does not identify the machine or process, only items within the process, however when a hosting process restarts(i.e. crash or reboot) the new IDs will not collide with IDs generated right before the crash for at least 14 days (14 day sliding window). In a parallel test on 6 Core i7 3.2 GHz this class generates 405 million IDs/sec, which is 57 times faster than Guid that only generates 7 million IDs/sec
Public structureScope _scopeExit
Public structureScope _scopeExit TCtx1 
Public structureScope _scopeExit TCtx1, TCtx2 
Public structureScope _scopeExit TCtx1, TCtx2, TCtx3 
Public structureScope _scopeExit TCtx1, TCtx2, TCtx3, TCtx4 
Public structureSealedString
Represents an immutable string data that is stored in an efficient way that relieves the GC pressure. The string can not be changed or deleted. Once created it stays as-is until the process is terminated. This structure is used to store much dictionary data (100s of millions of strings) in the process without causing GC overload. Note: The default .ctor DOES NOT check whether the same string is already present in memory. Use SealedString.Scope to store unique strings only (do not store the repetitions). This struct is THREAD SAFE and NOT SERIALIZABLE.
Interfaces

  InterfaceDescription
Public interfaceIEndableInstance
Describes an entity that can request some hosting container to end its lifetime by calling End() method
Public interfaceIExternallyParameterized
Denotes an entity that has external parameters that can be get/set
Public interfaceINamed
Denotes an entity that has a Name property. This interface is primarily used with Registry[INamed] class that allows for string-based addressing (getting instances by object instance name). The names are ideal for many system functions, like naming components in configs and admin tools
Public interfaceIOrdered
Denotes an entity that has a relative Order property within a collection of entities
Public interfaceIOrderedRegistry T 
Provides read-only named ordered object lookup capabilities
Public interfaceIParameter
Represents abstract parameter
Public interfaceIParameters
Represents abstract parameters bag
Public interfaceIRegistry T 
Provides read-only named object lookup capabilities
Enumerations

  EnumerationDescription
Public enumerationConvertErrorHandling
Specifies how to handle errors during object value conversion
Public enumerationDebugAction
Specifies how to handle Assertion and other failures
Public enumerationDumpFormat
Format of the String Dump
Public enumerationExternalParameterSecurityCheck
Specifies when security permissions should be checked while getting/setting extrenal parameters
Public enumerationObjectValueConversion TriStateBool
A "hack" enum used to provide tri-state checkbox functionality in some systems, i.e. HTML checkmarks do not understand "nulls". This is a surrogate type not used in server-side programming