Portability | unknown |
---|---|
Stability | unstable |
Maintainer | Conrad Parker <conrad@metadecks.org> |
API for implementing ZoomCache applications
- data TimeStamp = TS {}
- type TrackNo = Int
- data TrackType
- data DataRateType
- = ConstantDR
- | VariableDR
- data CacheFile = CacheFile {}
- class ZoomReadable a where
- readRaw :: (Functor m, MonadIO m) => Iteratee [Word8] m a
- readSummary :: (Functor m, MonadIO m) => Iteratee [Word8] m (SummaryData a)
- prettyRaw :: a -> String
- prettySummaryData :: SummaryData a -> String
- data ZoomRaw = forall a . ZoomReadable a => ZoomRaw [a]
- data ZoomSummary = forall a . ZoomReadable a => ZoomSummary (Summary a)
- data Packet = Packet {}
- data Summary a = Summary {}
- type TrackMap = IntMap TrackSpec
- data TrackSpec = TrackSpec {
- specType :: !TrackType
- specDRType :: !DataRateType
- specRate :: !Rational
- specName :: !ByteString
- class ZoomWrite t where
- type ZoomW = StateT ZoomWHandle IO
- withFileWrite :: TrackMap -> Bool -> ZoomW () -> FilePath -> IO ()
- flush :: ZoomW ()
- watermark :: TrackNo -> ZoomW (Maybe Int)
- setWatermark :: TrackNo -> Int -> ZoomW ()
- oneTrack :: TrackType -> DataRateType -> Rational -> ByteString -> TrackMap
- module Data.Iteratee.ZoomCache
- module Data.ZoomCache.Pretty
Types
data DataRateType Source
Constant or Variable datarate. For constant datarate, timestamps are implied as incrementing by 1/datarate For variable datarate, explicit timestamps are attached to each datum, encoded as a separate block of timestamps in the Raw Data packet.
Global and track headers for a zoom-cache file
class ZoomReadable a whereSource
A codec instance must specify a SummaryData
type,
and implement all methods of this class.
readRaw :: (Functor m, MonadIO m) => Iteratee [Word8] m aSource
An iteratee to read one value of type a
from a stream of '[Word8]'.
readSummary :: (Functor m, MonadIO m) => Iteratee [Word8] m (SummaryData a)Source
An iteratee to read one value of type 'SummaryData a' from a stream of '[Word8]'.
prettyRaw :: a -> StringSource
Pretty printing, used for dumping values of type a
.
prettySummaryData :: SummaryData a -> StringSource
Pretty printing for values of type 'SummaryData a'.
forall a . ZoomReadable a => ZoomRaw [a] |
data ZoomSummary Source
forall a . ZoomReadable a => ZoomSummary (Summary a) |
Packet | |
|
A recorded block of summary data
Track specification
A specification of the type and name of each track
TrackSpec | |
|
The ZoomWrite class
The ZoomWrite class provides write
, a method to write a
Haskell value to an open ZoomCache file.
The ZoomW monad
type ZoomW = StateT ZoomWHandle IOSource
A StateT IO monad for writing a ZoomCache file
:: TrackMap | |
-> Bool | Whether or not to write raw data packets. If False, only summary blocks are written. |
-> ZoomW () | |
-> FilePath | |
-> IO () |
Run a ZoomW ()
action on a given file handle, using the specified
TrackMap
specification
Force a flush of ZoomCache summary blocks to disk. It is not usually necessary to call this function as summary blocks are transparently written at regular intervals.
Watermarks
watermark :: TrackNo -> ZoomW (Maybe Int)Source
Query the maximum number of data points to buffer for a given track before forcing a flush of all buffered data and summaries.
setWatermark :: TrackNo -> Int -> ZoomW ()Source
Set the maximum number of data points to buffer for a given track before forcing a flush of all buffered data and summaries.
TrackSpec helpers
oneTrack :: TrackType -> DataRateType -> Rational -> ByteString -> TrackMapSource
Create a track map for a stream of a given type, as track no. 1
Iteratee parsers
module Data.Iteratee.ZoomCache
Pretty printing
module Data.ZoomCache.Pretty