unknown.py
Go to the documentation of this file.
00001 # -*- Python -*-
00002 # -*- coding: utf-8 -*-
00003 
00004 '''rtctree
00005 
00006 Copyright (C) 2009-2014
00007     Geoffrey Biggs
00008     RT-Synthesis Research Group
00009     Intelligent Systems Research Institute,
00010     National Institute of Advanced Industrial Science and Technology (AIST),
00011     Japan
00012     All rights reserved.
00013 Licensed under the Eclipse Public License -v 1.0 (EPL)
00014 http://www.opensource.org/licenses/eclipse-1.0.txt
00015 
00016 Object representing an unknown node in the tree.
00017 
00018 '''
00019 
00020 
00021 from rtctree.exceptions import *
00022 from rtctree.node import TreeNode
00023 
00024 
00025 ##############################################################################
00026 ## Unknown node object
00027 
00028 class Unknown(TreeNode):
00029     '''Node representing an unknown object on a name server.
00030 
00031     Unknown nodes can occur below name server and directory nodes. They
00032     cannot contain any children.
00033 
00034     '''
00035     def __init__(self, name, parent, obj):
00036         '''Constructor.
00037 
00038         @param name Name of this object (i.e. its entry in the path).
00039         @param parent The parent node of this node, if any.
00040         @param obj The CORBA object to wrap.
00041 
00042         '''
00043         super(Unknown, self).__init__(name, parent)
00044         self._obj = obj
00045 
00046     ###########################################################################
00047     # Node functionality
00048 
00049     @property
00050     def is_unknown(self):
00051         '''Is this node unknown?'''
00052         return True
00053 
00054     @property
00055     def object(self):
00056         '''The CORBA object this object wraps.'''
00057         with self._mutex:
00058             return self._obj
00059 
00060     ###########################################################################
00061     # Internal API
00062 
00063     def _add_child(self):
00064         # Unknowns cannot contain children.
00065         raise CannotHoldChildrenError
00066 
00067 
00068 # vim: tw=79
00069 


rtctree
Author(s): Geoffrey Biggs
autogenerated on Wed Aug 26 2015 16:13:08