singleton object

body DeviceObjectname::getObject {} {
   if {$m_theObject == {}} {
      #instantiate the singleton object
      set m_theObject [[namespace current] ::#auto]
   }
   return $m_theObject
}


singleton class cannot be directly instantiated. Use DeviceObjectname::getObject

posted @ 2012-10-02 14:38  greencolor  阅读(153)  评论(0编辑  收藏  举报