Womb : Womb Namespace
Atom

Base class for database atoms.

public abstract class Atom : ICloneable


Remarks
To be added.
Members

See Also: Inherited members from object.

Protected Constructors
To be added.
Fields
db
DB . To be added.
Protected Fields
ctor_info
System.Reflection.ConstructorInfo . To be added.
flags
AtomFlags . To be added.
laundry
Hashtable . To be added.
table
string . To be added.
tags
System.Reflection.PropertyInfo[]. To be added.
Properties
aid
System.Nullable`1[[System.Int64, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] . Atom ID
Db
DB . Connection to database
Flags [read-only]
AtomFlags . To be added.
LaundryList [read-only]
Hashtable . To be added.
Notify [write-only]
bool . Whether to emit the Womb.Atom.Changed event
Table [read-only]
string . Name of table the atom is mapped to
TagNames [read-only]
string[]. Names of the atom's tags
Tags [read-only]
System.Reflection.PropertyInfo[]. Reflection information for the atom's tags
Methods
Clone () : object
Creates an exact copy of an atom
Delete ()
Delete row from database
Nullify ()
Set all fields to null.
Nullify (bool)
Set all fields to null
SetTag (string, object)
Set the value for a tag
Write ()
Writes an atom to the database
Protected Methods
GetRealDB () : Npgsql.NpgsqlConnection
To be added.
NotifyChanged (string, object)
To be added.
RequestDict (string)
To be added.
Events
Changed
Data has changed in the atom
Member Details
Atom Constructor
protected Atom (string tab, bool isnew)

To be added.

Parameters
tab
To be added.
isnew
To be added.
Remarks
To be added.

Changed
public event ChangedHandler Changed

Data has changed in the atom

Remarks
Set the Womb.Atom.Notify flag to false if you don't want a particular atom to emit this event (eg. when you have to process a large set of atoms).

db
public DB db

To be added.

Remarks
To be added.

table
protected string table

To be added.

Remarks
To be added.

tags

To be added.

Remarks
To be added.

ctor_info

To be added.

Remarks
To be added.

laundry
protected Hashtable laundry

To be added.

Remarks
To be added.

flags
protected AtomFlags flags

To be added.

Remarks
To be added.

GetRealDB
protected Npgsql.NpgsqlConnection GetRealDB ()

To be added.

Returns
To be added.
Remarks
To be added.

RequestDict
protected void RequestDict (string tab)

To be added.

Parameters
tab
To be added.
Remarks
To be added.

NotifyChanged
protected void NotifyChanged (string tag, object val)

To be added.

Parameters
tag
To be added.
val
To be added.
Remarks
To be added.

SetTag
public void SetTag (string name, object data)

Set the value for a tag

Parameters
name
Name of tag
data
Value of tag
Remarks

This method sets a tag on an atom via reflection. Use this method to set tags indirectly on atoms at run-time. Otherwise, set the tags directly via regular property setters, eg. foo.x = 3.

The atom will emit a Womb.Atom.Changed event after the tag is set.


Write
public void Write ()

Writes an atom to the database

Remarks
If a row in the database table already exists for the atom's aid, the row will be updated with the new data; otherwise, a new row will be created and the atom will be assigned an aid as a side effect.

Delete
public void Delete ()

Delete row from database

Remarks
To be added.

Nullify
public void Nullify (bool keep_aid)

Set all fields to null

Parameters
keep_aid
Whether to keep atomID field intact
Remarks
If keep_aid is true, the atom will be nullified but its atomID tag will be left intact: further writes will keep writing to the same table row. if keep_aid is false, aid will be nullified so further writes will create a new row and the atom will be assigned a new atomID.

Nullify
public void Nullify ()

Set all fields to null.

Remarks
This method is equivalent to Womb.Atom.Nullify(bool) called with (true). See Womb.Atom.Nullify(bool) for details

Clone
public object Clone ()

Creates an exact copy of an atom

Returns
A copy of the atom
Remarks
To be added.

Db
public DB Db { set; get; }

Connection to database

Value
To be added.
Remarks
To be added.

Table
public string Table { get; }

Name of table the atom is mapped to

Value
To be added.
Remarks
To be added.

Tags
public System.Reflection.PropertyInfo[] Tags { get; }

Reflection information for the atom's tags

Value
An array of System.Reflection.PropertyInfo objects holding reflection information for the tags.
Remarks
This is mainly used by Womb.Gtk to find tags information from atoms. The array is shared among all instances of every atom subclass and this property returns a clone of the array.

TagNames
public string[] TagNames { get; }

Names of the atom's tags

Value
An array of strings with the tags names
Remarks
To be added.

Flags
public AtomFlags Flags { get; }

To be added.

Value
To be added.
Remarks
To be added.

Notify
public bool Notify { set; }

Whether to emit the Womb.Atom.Changed event

Value
To be added.
Remarks
To be added.

LaundryList
public Hashtable LaundryList { get; }

To be added.

Value
To be added.
Remarks
To be added.

aid

Atom ID

Value
To be added.
Remarks
This tag is used internally by womb. Do NOT use.