The TeaTime namespace provides classes to read and write TeaFiles. TeaFiles
are a simple and efficient way to store time series in flat files.
Classes
Class | Description | |
---|---|---|
EventTimeAttribute |
Defines the field of a struct holding the event time.
|
|
Field |
Describes the field of an item.
|
|
FileFormatException |
The header of a TeaFile has an invalid format.
|
|
InternalErrorException |
An internal error occured.
|
|
InvalidFieldTypeException |
The field of an item is of a type that can not be stored in a TeaFile.
|
|
InvalidStateException |
The object has an invalid state.
|
|
Item |
Holds the values of an Item when reading a TeaFile untyped.
|
|
ItemDescription |
Describes the type of items stored in a TeaFile.
|
|
ItemException |
The item type violates constraints.
|
|
ManagedMemoryMapping<(Of <(<'T>)>)> |
Access items in TeaFiles via safe memory mapping using MemoryMappedFile.
|
|
NameValue |
A name / value pair.
|
|
NameValueCollection |
A collection of name / value pairs.
|
|
RawMemoryMapping<(Of <(<'T>)>)> |
Access items in TeaFiles via unsafe raw memory mapping.
|
|
TeaFile |
Read TeaFiles without knowing anything about their content (untyped reading).
|
|
TeaFile<(Of <(<'T>)>)> |
Create, write and read TeaFiles using their item type (typed reading).
|
|
TeaFileDescription |
TeaFiles optionally hold a description, describing item layout and content.
|
|
TimescaleException |
The current default Timescale differs from the Timescale used in a file.
|
|
TypeMismatchException |
A TeaFile is read with a type that does not match the type it was written with.
|
Structures
Structure | Description | |
---|---|---|
Event<(Of <(<'T>)>)> |
Represents an event.
|
|
Time | ||
Timescale |
Describes how raw tick counts are converted to date and time values.
|
Interfaces
Interface | Description | |
---|---|---|
IItemCollection |
Provides access to items of untyped TeaFile.
|
|
IItemCollection<(Of <(<'T>)>)> |
Provides access to items using typed TeaFile<(Of <(<'T>)>)>.
|
Enumerations
Enumeration | Description | |
---|---|---|
FieldType |
Describes the types available for structs inside TeaFiles.
|
|
ItemDescriptionElements |
Describes the elements inside an ItemDescription.
|
|
ScaleCollisionBehavior |
Describes the behavior upon Timescale collision.
|
Remarks
TeaFile<(Of <(<'T>)>)> is used to create, write and read TeaFiles
Examples
CopyC#
struct Tick // the time series item type { public DateTime Time; public double Price; public int Volume; } // create file and write some values using (var tf = TeaFile<Tick>.Create("gold.tea")) { tf.Write(new Tick { Price = 5, Time = DateTime.Now, Volume = 700 }); tf.Write(new Tick { Price = 15, Time = DateTime.Now.AddHours(1), Volume = 1700 }); } // read typed using (var tf = TeaFile<Tick>.OpenRead("gold.tea")) { Tick value = tf.Read(); Console.WriteLine(value); }
If the type of items stored in a TeaFile is unknown, the file can still be opened using the non generic class TeaFile.
Examples
read untyped - we know nothing about the type of item in the fileCopyC#
using (var tf = TeaFile.OpenRead("gold.tea")) { foreach(Item item in tf.Items) { Console.WriteLine(tf.Description.ItemDescription.GetNameValueString(item)); } } // output: output: Price=5 Time=20.8.2011 23:50 Price=15 Time=21.8.2011 00:50