Home Units Hierarchy Routines All identifiers

Class unaAbstractStream

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type unaAbstractStream = class(unaObject)

Description

Simple First In First Out (FIFO) stream. It is multi-threaded safe, so you can use it from several threads without any special care.

Hierarchy

Overview

Methods

Public constructor create(lockTimeout: tTimeout = 1000); virtual;
Public destructor Destroy(); override;
Public function clear(): unaAbstractStream;
Public class function copyStream(source, dest: unaAbstractStream): int;
Public function enter(ro: bool; timeout: tTimeout = 10000): bool;
Public function getAvailableSize(): int;
Public function getSize(): int;
Public function read(def: boolean; remove: bool = true): bool; overload;
Public function read(buf: pointer; size: int; remove: bool = true): int; overload;
Public function read(def: unsigned; remove: bool = true): unsigned; overload;
Public function read(const def: aString; remove: bool = true): aString; overload;
Public function read(def: int; remove: bool = true): int; overload;
Public function read(def: byte; remove: bool = true): byte; overload;
Public function read(def: word; remove: bool = true): word; overload;
Public function readFrom(const fileName: wString; offset: int = 0): int; overload;
Public function readFrom(source: unaAbstractStream): int; overload;
Public function remove(size: int): int;
Public function waitForData(timeout: tTimeout = 1000): bool;
Public function write(value: int): int; overload;
Public function write(value: unsigned): int; overload;
Public function write(const value: aString): int; overload;
Public function write(value: boolean): int; overload;
Public function write(buf: pointer; size: int): int; overload;
Public function write(value: word): int; overload;
Public function write(value: byte): int; overload;
Public function writeTo(dest: unaAbstractStream): int; overload;
Public function writeTo(const fileName: wString; append: bool = true; size: int = 0): int; overload;
Protected function clear2(): unaAbstractStream; virtual;
Protected function getAvailableSize2(): int; virtual;
Protected function getPosition(): int; virtual;
Protected function getSize2(): int; virtual;
Protected function read2(buf: pointer; size: int; remove: bool = true): int; virtual; abstract;
Protected function remove2(size: int): int; virtual;
Protected function seek(position: int; fromBeggining: bool = true): int; overload; virtual;
Protected function seekD(delta: int): int; overload; virtual;
Protected function write2(buf: pointer; size: int): int; virtual;
Public procedure AfterConstruction(); override;
Public procedure leaveRO();
Public procedure leaveWO();

Properties

Public property dataEvent: unaEvent read f_dataEvent;
Public property isEmpty: bool read getIsEmpty;
Public property isValid: bool read f_isValid;
Public property lockTimeout: tTimeout read f_lockTimeout write f_lockTimeout default 1000;
Public property maxSize: int read f_maxSize write f_maxSize default 0;

Description

Methods

Public constructor create(lockTimeout: tTimeout = 1000); virtual;
 
Public destructor Destroy(); override;
 
Public function clear(): unaAbstractStream;
 
Public class function copyStream(source, dest: unaAbstractStream): int;
 
Public function enter(ro: bool; timeout: tTimeout = 10000): bool;
 
Public function getAvailableSize(): int;
 
Public function getSize(): int;
 
Public function read(def: boolean; remove: bool = true): bool; overload;
 
Public function read(buf: pointer; size: int; remove: bool = true): int; overload;
 
Public function read(def: unsigned; remove: bool = true): unsigned; overload;
 
Public function read(const def: aString; remove: bool = true): aString; overload;
 
Public function read(def: int; remove: bool = true): int; overload;
 
Public function read(def: byte; remove: bool = true): byte; overload;
 
Public function read(def: word; remove: bool = true): word; overload;
 
Public function readFrom(const fileName: wString; offset: int = 0): int; overload;
 
Public function readFrom(source: unaAbstractStream): int; overload;
 
Public function remove(size: int): int;
 
Public function waitForData(timeout: tTimeout = 1000): bool;
 
Public function write(value: int): int; overload;
 
Public function write(value: unsigned): int; overload;
 
Public function write(const value: aString): int; overload;
 
Public function write(value: boolean): int; overload;
 
Public function write(buf: pointer; size: int): int; overload;
 
Public function write(value: word): int; overload;
 
Public function write(value: byte): int; overload;
 
Public function writeTo(dest: unaAbstractStream): int; overload;
 
Public function writeTo(const fileName: wString; append: bool = true; size: int = 0): int; overload;
 
Protected function clear2(): unaAbstractStream; virtual;
 
Protected function getAvailableSize2(): int; virtual;
 
Protected function getPosition(): int; virtual;
 
Protected function getSize2(): int; virtual;
 
Protected function read2(buf: pointer; size: int; remove: bool = true): int; virtual; abstract;
 
Protected function remove2(size: int): int; virtual;
 
Protected function seek(position: int; fromBeggining: bool = true): int; overload; virtual;
 
Protected function seekD(delta: int): int; overload; virtual;
 
Protected function write2(buf: pointer; size: int): int; virtual;
 
Public procedure AfterConstruction(); override;
 
Public procedure leaveRO();
 
Public procedure leaveWO();
 

Properties

Public property dataEvent: unaEvent read f_dataEvent;
 
Public property isEmpty: bool read getIsEmpty;
 
Public property isValid: bool read f_isValid;
 
Public property lockTimeout: tTimeout read f_lockTimeout write f_lockTimeout default 1000;
 
Public property maxSize: int read f_maxSize write f_maxSize default 0;
 

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09