示例#1
0
 /**
  *
  * @param <array or object> $opList operation list or operation object
  */
 public function deliver(LogootOperation $operation)
 {
     $id = $operation->getLogootPosition();
     wfDebugLog('p2p', $this->clock . ' - function logootPlusEngine::deliver ' . get_class($operation) . "(" . $id . ")");
     $id = $operation->getLogootPosition();
     list($min, $val, $max) = $this->dichoSearch($id);
     if ($operation->type() == LogootOperation::INSERT && $val == NULL) {
         $dvis = $this->model->getCemetery($id) + 1;
         if ($dvis == 1) {
             $this->addPosition($max, $id);
             $this->addLine($max, $operation->getLineContent());
         } else {
             $this->model->setCemetery($id, $dvis);
         }
     } elseif ($operation->type() == LogootOperation::DELETE) {
         if (isset($val)) {
             $this->deletePosition($val);
             $this->deleteLine($val);
             $dvis = 0;
         } else {
             $dvis = $this->model->getCemetery($id) - 1;
         }
         $this->model->setCemetery($id, $dvis);
     } else {
         wfDebugLog('p2p', $this->clock . '- ' . __METHOD__ . ' - ' . __CLASS__ . '- unkown operation !!!');
         exit;
     }
 }
示例#2
0
 /**
  *
  * @param <array or object> $opList operation list or operation object
  */
 public function deliver(LogootOperation $operation)
 {
     $id = $operation->getLogootPosition();
     wfDebugLog('p2p', $this->clock . ' - function logootEngine::deliver ' . get_class($operation) . "(" . $id . ")");
     list($min, $val, $max) = $this->dichoSearch($id);
     if ($operation instanceof LogootIns) {
         $this->addPosition($max, $id);
         $this->addLine($max, $operation->getLineContent());
     } elseif ($operation instanceof LogootDel) {
         if (isset($val)) {
             $this->deletePosition($val);
             $this->deleteLine($val);
         }
     } else {
         wfDebugLog('p2p', $this->clock . '- ' . __METHOD__ . ' - ' . __CLASS__ . '- unkown operation !!!');
         exit;
     }
 }
示例#3
0
文件: LogootDel.php 项目: hala54/DSMW
 /**
  *
  * @param <Object> $position LogootPosition
  * @param <String> $content line content 
  */
 function __construct(LogootPosition $position, $content)
 {
     parent::__construct($position, $content);
 }
示例#4
0
 public function __construct(LogootPosition $position, $content)
 {
     parent::__construct($position, $content);
     $this->isInv = false;
 }