introduced GetMessageCount

This commit is contained in:
Michael Meckelein 2008-03-14 13:29:38 +01:00
parent 31c4644014
commit d6a323cfab
2 changed files with 23 additions and 0 deletions

View File

@ -137,6 +137,18 @@ abstract class LogStream {
* @return integer Error state
*/
public abstract function Sseek(&$uID, $mode, $numrecs);
/**
* If you are interested in how many messages are in the stream, call this method.
* But be aware of that some stream can not provide a message count. This is probably
* because of performance reason or any other. However, if GetMessageCount return -1
* this does not mean that there is no message in the stream, it is just not countable.
* If there is no message 0 will be returned.
*
* @return integer Amount of messages within the stream. -1 means that no count is available.
*/
public abstract function GetMessageCount();
}

View File

@ -378,6 +378,17 @@ class LogStreamDisk extends LogStream {
return SUCCESS;
}
/**
* GetMessageCount will always return -1 which means
* that the message count is not available. We refuse
* the request of the message count due to a count would
* require to read the whole file which would be a big
* pain if the file is e.g. 1 gb.
*/
public function GetMessageCount() {
return -1;
}
/**
* Set the direction the stream should read data.
*