Meteor-Unity  3
A C#-based SDK for connecting Unity to Meteor servers
Public Member Functions | Protected Attributes | Properties | List of all members
Meteor.Observe< TRecordType > Class Template Reference

An observe handle. Returned by Meteor.Cursor.Find. More...

Inheritance diagram for Meteor.Observe< TRecordType >:

Public Member Functions

 Observe (Collection< TRecordType > collection, Action< string, TRecordType > added=null, Action< string, TRecordType, IDictionary, string[]> changed=null, Action< string > removed=null, Func< TRecordType, bool > selector=null, IEnumerable< string > fields=null)
 Creates a new observe handle without a cursor. It is recommended to use Meteor.Collection`1.Find to get a cursor and then call More...
 
void Stop ()
 Stops observing changes to the collection with the given selector. More...
 
void Dispose ()
 Releases all resource used by the Meteor.Observe`1 object. More...
 

Protected Attributes

HashSet< String > Fields
 
string idToRemove
 

Properties

Action< string, TRecordType > Added [get]
 Raised after a documented is added. The first parameter is the document's id, and the second is the record data. More...
 
Action< string, TRecordType, IDictionary, string[]> Changed [get]
 Raised after a document is changed. The first parameter is the record id, the second is the new record, the third is a dictionary of changes and the last is the list of cleared fields, if any. More...
 
Action< string > Removed [get]
 Raised after a document is removed. The first parameter is the record's id. More...
 
Func< TRecordType, bool > RecordSelector [get]
 
bool Initializing [get, protected set]
 Is this observe handle receiving its first matching set of documents to add? More...
 
Collection< TRecordType > Collection [get, protected set]
 Gets the collection referenced by this observe handle. More...
 

Detailed Description

An observe handle. Returned by Meteor.Cursor.Find.

Type Constraints
TRecordType :MongoDocument 
TRecordType :new() 

Constructor & Destructor Documentation

Meteor.Observe< TRecordType >.Observe ( Collection< TRecordType >  collection,
Action< string, TRecordType >  added = null,
Action< string, TRecordType, IDictionary, string[]>  changed = null,
Action< string >  removed = null,
Func< TRecordType, bool >  selector = null,
IEnumerable< string >  fields = null 
)
inline

Creates a new observe handle without a cursor. It is recommended to use Meteor.Collection`1.Find to get a cursor and then call

Observe on that cursor. An observe invokes callbacks when the result of the query changes. The callbacks receive the entire contents of the document that was affected, as well as its old contents, if applicable. Before observe returns, added will be called zero or more times to deliver the initial results of the query. This method returns an Observe instance, which is an object with a stop method. Call stop with no arguments to stop calling the callback functions and tear down the query. The query will run forever until you call this.

Parameters
addedA new document document entered the result set.
changedA callback for changes to documents. The first argument is the ID, the second the entire record, the third a dictionary of fields that were changed as keys and the new values as values, and an array of strings specifying any deleted fields. The second argument, the entire document, has the changes already applied to it.
removedA document with the given ID was removed. The callback is called after the document is removed from the collection.
collectionCollection.
selectorSelector.
fieldsFields. Currently not supported.

Member Function Documentation

void Meteor.Observe< TRecordType >.Dispose ( )
inline

Releases all resource used by the Meteor.Observe`1 object.

Call Dispose when you are finished using the Meteor.Observe`1. The Dispose method leaves the Meteor.Observe`1 in an unusable state. After calling Dispose, you must release all references to the Meteor.Observe`1 so the garbage collector can reclaim the memory that the Meteor.Observe`1 was occupying.

void Meteor.Observe< TRecordType >.Stop ( )
inline

Stops observing changes to the collection with the given selector.

Property Documentation

Action<string,TRecordType> Meteor.Observe< TRecordType >.Added
get

Raised after a documented is added. The first parameter is the document's id, and the second is the record data.

Action<string,TRecordType,IDictionary,string[]> Meteor.Observe< TRecordType >.Changed
get

Raised after a document is changed. The first parameter is the record id, the second is the new record, the third is a dictionary of changes and the last is the list of cleared fields, if any.

Collection<TRecordType> Meteor.Observe< TRecordType >.Collection
getprotected set

Gets the collection referenced by this observe handle.

The collection.

bool Meteor.Observe< TRecordType >.Initializing
getprotected set

Is this observe handle receiving its first matching set of documents to add?

true if initializing; otherwise, false.

Action<string> Meteor.Observe< TRecordType >.Removed
get

Raised after a document is removed. The first parameter is the record's id.


The documentation for this class was generated from the following file: