示例#1
0
 /**
  * Class Constructor
  *
  * @param 	GlobalMainCfg 	$MAINCFG
  * @param 	GlobalMapCfg 	$MAPCFG
  * @author 	Lars Michelsen <*****@*****.**>
  */
 public function __construct($MAPCFG, $getState = GET_STATE, $bIsView = IS_VIEW)
 {
     global $_BACKEND;
     $this->MAPCFG = $MAPCFG;
     if ($getState === GET_STATE) {
         $this->MAPOBJ = new NagVisMapObj($MAPCFG, $bIsView);
         // FIXME: needed? $this->MAPOBJ->setConfiguration($this->MAPCFG->getTypeDefaults('global'));
         $objConf = $MAPCFG->getMapObject(0);
         unset($objConf['type']);
         $this->MAPOBJ->setConfiguration($objConf);
         log_mem('postmapinit');
         $this->MAPOBJ->fetchMapObjects();
         log_mem('map ' . $this->MAPCFG->getName() . ' ' . count($this->MAPOBJ->getMembers()));
         log_mem('postmapobjects');
         if ($bIsView === IS_VIEW) {
             $this->MAPOBJ->queueState(GET_STATE, GET_SINGLE_MEMBER_STATES);
             $_BACKEND->execute();
             $this->MAPOBJ->applyState();
             log_mem('postmapstate');
         } else {
             $this->MAPOBJ->queueState(GET_STATE, DONT_GET_SINGLE_MEMBER_STATES);
             log_mem('postmapstatequeue');
         }
     }
 }