db Namespace Reference

add persistent data to the BID server More...


Functions

string _GetFile (type token)
string Read (type token, optional default="")
 read the token from the database
string Write (type token, type value)
 write the value of token into database
string Delete (type token)
 delete the token from the database
string Incr (type token, optional num=1)
 increment the value of token from the database
string MkDir (type database)
 create an additional sub-database into the already existing default database
string DeleteDir (type database)
 delete sub-database from the already existing default database
string Lock (type token)
 get the lock for database token


Detailed Description

add persistent data to the BID server

Attention:
The doxygen documentation builder was primary developted for the C, C++, JAVA, ... language documentation and does not support the Tcl syntax.
The following translation rules have to be applied:
variable string NAME = DEFAULT set NAME DEFAULT
variable array NAME = DEFAULT array set NAME DEFAULT
procedure string NAME ( type ARG1, ... ) proc NAME {ARG1 ...}
procedure string NAME ( optional ARG1=DEF1, ... ) proc NAME {{ARG1 DEF1} ...}
The db package from file lib/libDb.tcl is available with:
package require db ?1.0?
and is used as an interface to the local file based database to implement a persistent workflow. The database is located in the db sub-directory of the local BID installation.
Attention:
To support an other database customize this file with your local needs.


Function Documentation

string db::_GetFile ( type  token  ) 

string db::Read ( type  token,
optional  default = "" 
)

read the token from the database

Parameters:
token the token to read
default the default value used if token is not available (default: "")
Returns:
the value of the token

string db::Write ( type  token,
type  value 
)

write the value of token into database

Parameters:
token the token to write
value the value of the token

string db::Delete ( type  token  ) 

delete the token from the database

Parameters:
token the token to delete

string db::Incr ( type  token,
optional  num = 1 
)

increment the value of token from the database

Parameters:
token the token to delete
num the increment (default: 1)
Attention:
if the token does not exist the value is set to the default increment

string db::MkDir ( type  database  ) 

create an additional sub-database into the already existing default database

Parameters:
database the name of the database
Returns:
the absolute path of the new database
To add data into the new database use the new database name as directory prefix
db::MkDir my_new_data_storage
db::Write my_new_data_storage/my_new_token  "hallo otto"

string db::DeleteDir ( type  database  ) 

delete sub-database from the already existing default database

Parameters:
database the database to delete
Attention:
if the database does not exist no error is returned

string db::Lock ( type  token  ) 

get the lock for database token

Parameters:
token the token to get the lock for
Returns:
yes if the caller has the lock and no if not
Attention:
the lock token can not be used to store other information as the lock itself
Cross platform process verification is tricky at least tcl does not provide anything by default. Currently the /proc interface is used and this will not work on some UNIX like: HP-UX


Generated on Thu Sep 13 21:19:10 2007 for bid by  doxygen 1.5.0