SequoiaDB
 All Classes Namespaces Files Functions Variables Enumerations Properties Pages
Public Member Functions | Static Public Member Functions | Properties | List of all members
SequoiaDB.Bson.ObjectId Struct Reference

Represents an ObjectId (see also BsonObjectId). More...

Inheritance diagram for SequoiaDB.Bson.ObjectId:

Public Member Functions

 ObjectId (byte[] bytes)
 Initializes a new instance of the ObjectId class.
 
 ObjectId (DateTime timestamp, int machine, short pid, int increment)
 Initializes a new instance of the ObjectId class.
 
 ObjectId (int timestamp, int machine, short pid, int increment)
 Initializes a new instance of the ObjectId class.
 
 ObjectId (string value)
 Initializes a new instance of the ObjectId class.
 
int CompareTo (ObjectId other)
 Compares this ObjectId to another ObjectId.
 
bool Equals (ObjectId rhs)
 Compares this ObjectId to another ObjectId.
 
override bool Equals (object obj)
 Compares this ObjectId to another object.
 
override int GetHashCode ()
 Gets the hash code.
 
byte[] ToByteArray ()
 Converts the ObjectId to a byte array.
 
override string ToString ()
 Returns a string representation of the value.
 
TypeCode IConvertible. GetTypeCode ()
 
bool IConvertible. ToBoolean (IFormatProvider provider)
 
byte IConvertible. ToByte (IFormatProvider provider)
 
char IConvertible. ToChar (IFormatProvider provider)
 
DateTime IConvertible. ToDateTime (IFormatProvider provider)
 
decimal IConvertible. ToDecimal (IFormatProvider provider)
 
double IConvertible. ToDouble (IFormatProvider provider)
 
short IConvertible. ToInt16 (IFormatProvider provider)
 
int IConvertible. ToInt32 (IFormatProvider provider)
 
long IConvertible. ToInt64 (IFormatProvider provider)
 
sbyte IConvertible. ToSByte (IFormatProvider provider)
 
float IConvertible. ToSingle (IFormatProvider provider)
 
string IConvertible. ToString (IFormatProvider provider)
 
object IConvertible. ToType (Type conversionType, IFormatProvider provider)
 
ushort IConvertible. ToUInt16 (IFormatProvider provider)
 
uint IConvertible. ToUInt32 (IFormatProvider provider)
 
ulong IConvertible. ToUInt64 (IFormatProvider provider)
 

Static Public Member Functions

static ObjectId ()
 
static bool operator< (ObjectId lhs, ObjectId rhs)
 Compares two ObjectIds.
 
static bool operator<= (ObjectId lhs, ObjectId rhs)
 Compares two ObjectIds.
 
static bool operator== (ObjectId lhs, ObjectId rhs)
 Compares two ObjectIds.
 
static bool operator!= (ObjectId lhs, ObjectId rhs)
 Compares two ObjectIds.
 
static bool operator>= (ObjectId lhs, ObjectId rhs)
 Compares two ObjectIds.
 
static bool operator> (ObjectId lhs, ObjectId rhs)
 Compares two ObjectIds.
 
static ObjectId GenerateNewId ()
 Generates a new ObjectId with a unique value.
 
static ObjectId GenerateNewId (DateTime timestamp)
 Generates a new ObjectId with a unique value (with the timestamp component based on a given DateTime).
 
static ObjectId GenerateNewId (int timestamp)
 Generates a new ObjectId with a unique value (with the given timestamp).
 
static byte[] Pack (int timestamp, int machine, short pid, int increment)
 Packs the components of an ObjectId into a byte array.
 
static ObjectId Parse (string s)
 Parses a string and creates a new ObjectId.
 
static bool TryParse (string s, out ObjectId objectId)
 Tries to parse a string and create a new ObjectId.
 
static void Unpack (byte[] bytes, out int timestamp, out int machine, out short pid, out int increment)
 Unpacks a byte array into the components of an ObjectId.
 

Properties

static ObjectId Empty [get]
 Gets an instance of ObjectId where the value is empty.
 
int Timestamp [get]
 Gets the timestamp.
 
int Machine [get]
 Gets the machine.
 
short Pid [get]
 Gets the PID.
 
int Increment [get]
 Gets the increment.
 
DateTime CreationTime [get]
 Gets the creation time (derived from the timestamp).
 

Detailed Description

Represents an ObjectId (see also BsonObjectId).

Constructor & Destructor Documentation

static SequoiaDB.Bson.ObjectId.ObjectId ( )
inlinestatic
SequoiaDB.Bson.ObjectId.ObjectId ( byte[]  bytes)
inline

Initializes a new instance of the ObjectId class.

Parameters
bytesThe bytes.
SequoiaDB.Bson.ObjectId.ObjectId ( DateTime  timestamp,
int  machine,
short  pid,
int  increment 
)
inline

Initializes a new instance of the ObjectId class.

Parameters
timestampThe timestamp (expressed as a DateTime).
machineThe machine hash.
pidThe PID.
incrementThe increment.
SequoiaDB.Bson.ObjectId.ObjectId ( int  timestamp,
int  machine,
short  pid,
int  increment 
)
inline

Initializes a new instance of the ObjectId class.

Parameters
timestampThe timestamp.
machineThe machine hash.
pidThe PID.
incrementThe increment.
SequoiaDB.Bson.ObjectId.ObjectId ( string  value)
inline

Initializes a new instance of the ObjectId class.

Parameters
valueThe value.

Member Function Documentation

int SequoiaDB.Bson.ObjectId.CompareTo ( ObjectId  other)
inline

Compares this ObjectId to another ObjectId.

Parameters
otherThe other ObjectId.
Returns
A 32-bit signed integer that indicates whether this ObjectId is less than, equal to, or greather than the other.
bool SequoiaDB.Bson.ObjectId.Equals ( ObjectId  rhs)
inline

Compares this ObjectId to another ObjectId.

Parameters
rhsThe other ObjectId.
Returns
True if the two ObjectIds are equal.
override bool SequoiaDB.Bson.ObjectId.Equals ( object  obj)
inline

Compares this ObjectId to another object.

Parameters
objThe other object.
Returns
True if the other object is an ObjectId and equal to this one.
static ObjectId SequoiaDB.Bson.ObjectId.GenerateNewId ( )
inlinestatic

Generates a new ObjectId with a unique value.

Returns
An ObjectId.
static ObjectId SequoiaDB.Bson.ObjectId.GenerateNewId ( DateTime  timestamp)
inlinestatic

Generates a new ObjectId with a unique value (with the timestamp component based on a given DateTime).

Parameters
timestampThe timestamp component (expressed as a DateTime).
Returns
An ObjectId.
static ObjectId SequoiaDB.Bson.ObjectId.GenerateNewId ( int  timestamp)
inlinestatic

Generates a new ObjectId with a unique value (with the given timestamp).

Parameters
timestampThe timestamp component.
Returns
An ObjectId.
override int SequoiaDB.Bson.ObjectId.GetHashCode ( )
inline

Gets the hash code.

Returns
The hash code.
TypeCode IConvertible. SequoiaDB.Bson.ObjectId.GetTypeCode ( )
inline
static bool SequoiaDB.Bson.ObjectId.operator!= ( ObjectId  lhs,
ObjectId  rhs 
)
inlinestatic

Compares two ObjectIds.

Parameters
lhsThe first ObjectId.
rhsThe other ObjectId.
Returns
True if the two ObjectIds are not equal.
static bool SequoiaDB.Bson.ObjectId.operator< ( ObjectId  lhs,
ObjectId  rhs 
)
inlinestatic

Compares two ObjectIds.

Parameters
lhsThe first ObjectId.
rhsThe other ObjectId
Returns
True if the first ObjectId is less than the second ObjectId.
static bool SequoiaDB.Bson.ObjectId.operator<= ( ObjectId  lhs,
ObjectId  rhs 
)
inlinestatic

Compares two ObjectIds.

Parameters
lhsThe first ObjectId.
rhsThe other ObjectId
Returns
True if the first ObjectId is less than or equal to the second ObjectId.
static bool SequoiaDB.Bson.ObjectId.operator== ( ObjectId  lhs,
ObjectId  rhs 
)
inlinestatic

Compares two ObjectIds.

Parameters
lhsThe first ObjectId.
rhsThe other ObjectId.
Returns
True if the two ObjectIds are equal.
static bool SequoiaDB.Bson.ObjectId.operator> ( ObjectId  lhs,
ObjectId  rhs 
)
inlinestatic

Compares two ObjectIds.

Parameters
lhsThe first ObjectId.
rhsThe other ObjectId
Returns
True if the first ObjectId is greather than the second ObjectId.
static bool SequoiaDB.Bson.ObjectId.operator>= ( ObjectId  lhs,
ObjectId  rhs 
)
inlinestatic

Compares two ObjectIds.

Parameters
lhsThe first ObjectId.
rhsThe other ObjectId
Returns
True if the first ObjectId is greather than or equal to the second ObjectId.
static byte [] SequoiaDB.Bson.ObjectId.Pack ( int  timestamp,
int  machine,
short  pid,
int  increment 
)
inlinestatic

Packs the components of an ObjectId into a byte array.

Parameters
timestampThe timestamp.
machineThe machine hash.
pidThe PID.
incrementThe increment.
Returns
A byte array.
static ObjectId SequoiaDB.Bson.ObjectId.Parse ( string  s)
inlinestatic

Parses a string and creates a new ObjectId.

Parameters
sThe string value.
Returns
A ObjectId.
bool IConvertible. SequoiaDB.Bson.ObjectId.ToBoolean ( IFormatProvider  provider)
inline
byte IConvertible. SequoiaDB.Bson.ObjectId.ToByte ( IFormatProvider  provider)
inline
byte [] SequoiaDB.Bson.ObjectId.ToByteArray ( )
inline

Converts the ObjectId to a byte array.

Returns
A byte array.
char IConvertible. SequoiaDB.Bson.ObjectId.ToChar ( IFormatProvider  provider)
inline
DateTime IConvertible. SequoiaDB.Bson.ObjectId.ToDateTime ( IFormatProvider  provider)
inline
decimal IConvertible. SequoiaDB.Bson.ObjectId.ToDecimal ( IFormatProvider  provider)
inline
double IConvertible. SequoiaDB.Bson.ObjectId.ToDouble ( IFormatProvider  provider)
inline
short IConvertible. SequoiaDB.Bson.ObjectId.ToInt16 ( IFormatProvider  provider)
inline
int IConvertible. SequoiaDB.Bson.ObjectId.ToInt32 ( IFormatProvider  provider)
inline
long IConvertible. SequoiaDB.Bson.ObjectId.ToInt64 ( IFormatProvider  provider)
inline
sbyte IConvertible. SequoiaDB.Bson.ObjectId.ToSByte ( IFormatProvider  provider)
inline
float IConvertible. SequoiaDB.Bson.ObjectId.ToSingle ( IFormatProvider  provider)
inline
override string SequoiaDB.Bson.ObjectId.ToString ( )
inline

Returns a string representation of the value.

Returns
A string representation of the value.
string IConvertible. SequoiaDB.Bson.ObjectId.ToString ( IFormatProvider  provider)
inline
object IConvertible. SequoiaDB.Bson.ObjectId.ToType ( Type  conversionType,
IFormatProvider  provider 
)
inline
ushort IConvertible. SequoiaDB.Bson.ObjectId.ToUInt16 ( IFormatProvider  provider)
inline
uint IConvertible. SequoiaDB.Bson.ObjectId.ToUInt32 ( IFormatProvider  provider)
inline
ulong IConvertible. SequoiaDB.Bson.ObjectId.ToUInt64 ( IFormatProvider  provider)
inline
static bool SequoiaDB.Bson.ObjectId.TryParse ( string  s,
out ObjectId  objectId 
)
inlinestatic

Tries to parse a string and create a new ObjectId.

Parameters
sThe string value.
objectIdThe new ObjectId.
Returns
True if the string was parsed successfully.
static void SequoiaDB.Bson.ObjectId.Unpack ( byte[]  bytes,
out int  timestamp,
out int  machine,
out short  pid,
out int  increment 
)
inlinestatic

Unpacks a byte array into the components of an ObjectId.

Parameters
bytesA byte array.
timestampThe timestamp.
machineThe machine hash.
pidThe PID.
incrementThe increment.

Property Documentation

DateTime SequoiaDB.Bson.ObjectId.CreationTime
get

Gets the creation time (derived from the timestamp).

ObjectId SequoiaDB.Bson.ObjectId.Empty
staticget

Gets an instance of ObjectId where the value is empty.

int SequoiaDB.Bson.ObjectId.Increment
get

Gets the increment.

int SequoiaDB.Bson.ObjectId.Machine
get

Gets the machine.

short SequoiaDB.Bson.ObjectId.Pid
get

Gets the PID.

int SequoiaDB.Bson.ObjectId.Timestamp
get

Gets the timestamp.


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