Class MyCom

Description

The MySQL Communication Class

it extends the ComBasic Class and Implement it's Abstract Methods one thing specific to this Communication Scheme is that it doesn't use neither Sync class nor Writting Methodology Class , as it depends on the support of this in MySQL itself it's problem is that even it uses Heap tables it's not as fast as Shared Memory (when using ie WELL) nor it's as Available as Flat Files

  • todo: Write Classes for more DBMS and an abstract one to wrap them

Located in /Com/MyCom.php (line 24)

ComBasic
   |
   --MyCom
Variable Summary
 string $Table
Method Summary
 MyCom MyCom (string $hostname, string $username, string $pass, stringe $DB, [string $Tablename = ""])
 void Clear ()
 Boolean Exist (string $name)
 string Get (string $name)
 void Init ()
 Boolean Set (string $name, string $value)
Variables
string $Table (line 37)

Table name to be used for Communication

  • access: public
Methods
Constructor MyCom (line 53)

The MySQL Communication Class Constructor

This class is called in THE SAME way for two purposes :- 1) From the Mother Thread and then it's Inited for creating the table

2) From a child thread that wants to Communicate

MyCom MyCom (string $hostname, string $username, string $pass, stringe $DB, [string $Tablename = ""])
  • string $hostname: The MySQL host
  • string $username: MySQL Authorized username
  • string $pass: user pass
  • stringe $DB: MySQL DB to be used
  • string $Tablename: The Table name to be used
Clear (line 135)

MySQL Communication Specific Clearing Function

Just Drop the table

void Clear ()

Redefinition of:
ComBasic::Clear()
This is a void function with no arguments
Exist (line 124)

MySQL Communication Specific Existance Checking Function

Check if the result of SELECTing the Prob $name has any affected rows

Boolean Exist (string $name)
  • string $name

Redefinition of:
ComBasic::Exist()
Value returning function with arguments
Get (line 106)

MySQL Communication Specific Getting Function

Select the $value of $name from the Communication Table

  • return: the value Associated with name
string Get (string $name)
  • string $name

Redefinition of:
ComBasic::Get()
Value returning function with arguments
Init (line 69)

MySQL Communication Specific Init Function

(For pupose of this function review ComBasic abstract class documentation)

For the MyCom class the role of this function is to create the table used for communication , it starts with name "process" and then continues till find an idle name

void Init ()

Redefinition of:
ComBasic::Init()
This is a void function with no arguments
Set (line 89)

MySQL Communication Specific Setting Function

Here the function tries to insert a new row containing new $name and $value

Boolean Set (string $name, string $value)
  • string $name
  • string $value

Redefinition of:
ComBasic::Set()
void function with arguments

Inherited Methods

Inherited From ComBasic

 ComBasic::Clear()
 ComBasic::Exist()
 ComBasic::Get()
 ComBasic::Init()
 ComBasic::Set()

Documentation generated on Fri, 01 Aug 2008 05:54:15 +0300 by phpDocumentor 1.4.1