HS.SDA3.QuickStream
stream class HS.SDA3.QuickStream extends %Stream.Object
Stream class that stores character data in global nodes.This is cloned from %Stream.GlobalCharacter, for use for quick messaging. Both the temporary and stored version of the stream are stored in the same place, usually ^CacheTemp.HS.Stream(Id). The Id is assigned when the stream is created, and the creator can pass in an ID as an argument to %New.
Unlike %Stream.GlobalCharacter, this never participates in a transaction, and is never journaled. This drastically reduces both journal usage and contention, eliminating performance delays.
Optionally, one of these can be created using %New(,0). This is a hybrid usage, which stores both the temporary and stored versions in ^HS.Stream(id). It's somewhat slower, since this is journalled, but it's still used outside the scope of transactions, and the stream ID can be passed around in Ensemble messages to avoid repeated saving of the stream. This variation should be used, for instance, with Async messaging of inbound data, where the stream needs to survive a machine crash.
Property Inventory
Method Inventory
- %DeleteData()
- %Exists()
- %NormalizeObject()
- %ValidateObject()
- Clear()
- CopyFrom()
- CopyFromAndSave()
- Flush()
- GSave()
- Initialize()
- IsNull()
- LastModifiedGet()
- MoveToEnd()
- OutputToDevice()
- Read()
- ReadLine()
- ReadLineIntoStream()
- Rewind()
- SizeGet()
- TestCopy()
- Write()
- WriteLine()
Parameters
Properties
Methods
Returns %Boolean TRUE is it exists, FALSE if it does not.
This method validates an object.
The %Save() method of a persistent class calls this method before filing any objects in the database. The %ValidateObject() of a referencing object can call it. You can also call it explicitly at any time.
%ValidateObject() does the following:
- If present, it will call a user-supplied %OnValidateObject() method.
- It checks if any required property values are missing.
- If the PROPERTYVALIDATION class parameter is set to ValidateOnSave, it validates each non-null property value by calling the property method IsValid on each literal property and the %ValidateObject method for each object-valued embedded object property (properties whose type extend %SerialObject).
- If checkserial is 1, it forces the checking of any embedded object properties by calling their %ValidateObject method after swizzling this property.
- If checkserial is 2, it forces the checking of any collections of serial types by iterating over those collections and calling their %ValidateObject() method after swizzling this property, in addition to the validation that occurs when checkserial is 1.
%ValidateObject() returns a %Status indicating success or error. It is up to the caller to process the error value.
%ValidateObject() does not validate object-valued reference properties (properties whose type extends %Persistent) due to the possibility of circular dependencies between objects. The %Save() method of a persistent class automatically detects and handles circular references between objects. If you require the validation of reference properties, you can override this method in a subclass or call %Save() directly.
Returns a %Status value indicating success or failure.
For example, you can copy oldstream into a new stream:
Set newstream=##class(%GlobalCharacterStream).%New() Do newstream.CopyFrom(oldstream)
Returns a %Status value indicating success or failure.
Note that any locking or transaction handling must be done by the caller.
Returns a %Status value indicating success or failure.
You must call Rewind() if you want to read a stream from the beginning again. Calling Read() after Write() implicitly ends the Write() operation and rewinds to the start of the stream.
Returns a string up to len characters long. The byref argument sc will return a %Status if any error occurred during the read.
While 'stream.AtEnd { Write stream.ReadLine(,.sc,.eol) If $$$ISERR(sc) { Write "ERROR" Quit } If eol { Write ! } }
Note that a write operation immediately following a read or rewind will clear out the existing data in the stream.
Returns a %Status value indicating success or failure.
Returns a %Status value indicating success or failure.
Inherited Members
Inherited Properties
Inherited Methods
- %AddToSaveSet()
- %CheckUnique()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %Delete()
- %DeleteExtent()
- %DeleteId()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %ExistsId()
- %Extends()
- %GetParameter()
- %GetSwizzleObject()
- %Id()
- %IsA()
- %IsModified()
- %IsNull()
- %KillExtent()
- %LOBPrefetch()
- %LocationSet()
- %LockStream()
- %New()
- %ObjectIsNull()
- %ObjectModified()
- %ObjectSize()
- %Oid()
- %Open()
- %OpenId()
- %OriginalNamespace()
- %PackageName()
- %ReleaseLock()
- %Reload()
- %RemoveFromSaveSet()
- %RollBack()
- %Save()
- %SerializeObject()
- %SetModified()
- %UnlockStream()
- FindAt()
- GetStreamId()
- InputFromDevice()
- IsCharacter()
- MoveTo()
- OutputToDeviceAt()
- ReadSQL()
- SerializeToSyncSet()
- StreamOIDIsNull()
- SyncStreamIn()