/usr/lib/python2.7/dist-packages/Ice/ValueFactory_ice.py is in python-zeroc-ice 3.7.0-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | # -*- coding: utf-8 -*-
# **********************************************************************
#
# Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# **********************************************************************
#
# Ice version 3.7.0
#
# <auto-generated>
#
# Generated from file `ValueFactory.ice'
#
# Warning: do not edit this file.
#
# </auto-generated>
#
from sys import version_info as _version_info_
import Ice, IcePy
# Start of module Ice
_M_Ice = Ice.openModule('Ice')
__name__ = 'Ice'
if 'ValueFactory' not in _M_Ice.__dict__:
_M_Ice.ValueFactory = Ice.createTempClass()
class ValueFactory(object):
"""
A factory for values. Value factories are used in several
places, such as when Ice receives a class instance and
when Freeze restores a persistent value. Value factories
must be implemented by the application writer and registered
with the communicator.
"""
def __init__(self):
if Ice.getType(self) == _M_Ice.ValueFactory:
raise RuntimeError('Ice.ValueFactory is an abstract class')
def create(self, type):
"""
Create a new value for a given value type. The type is the
absolute Slice type id, i.e., the id relative to the
unnamed top-level Slice module. For example, the absolute
Slice type id for an interface Bar in the module
Foo is ::Foo::Bar.
The leading "::" is required.
Arguments:
type -- The value type.
Returns: The value created for the given type, or nil if the factory is unable to create the value.
"""
raise NotImplementedError("method 'create' not implemented")
def __str__(self):
return IcePy.stringify(self, _M_Ice._t_ValueFactory)
__repr__ = __str__
_M_Ice._t_ValueFactory = IcePy.defineValue('::Ice::ValueFactory', ValueFactory, -1, (), False, True, None, ())
ValueFactory._ice_type = _M_Ice._t_ValueFactory
_M_Ice.ValueFactory = ValueFactory
del ValueFactory
if 'ValueFactoryManager' not in _M_Ice.__dict__:
_M_Ice.ValueFactoryManager = Ice.createTempClass()
class ValueFactoryManager(object):
"""
A value factory manager maintains a collection of value factories.
An application can supply a custom implementation during communicator
initialization, otherwise Ice provides a default implementation.
"""
def __init__(self):
if Ice.getType(self) == _M_Ice.ValueFactoryManager:
raise RuntimeError('Ice.ValueFactoryManager is an abstract class')
def add(self, factory, id):
"""
Add a value factory. Attempting to add a
factory with an id for which a factory is already registered
throws AlreadyRegisteredException.
When unmarshaling an Ice value, the Ice run time reads the
most-derived type id off the wire and attempts to create an
instance of the type using a factory. If no instance is created,
either because no factory was found, or because all factories
returned nil, the behavior of the Ice run time depends on the
format with which the value was marshaled:
If the value uses the "sliced" format, Ice ascends the class
hierarchy until it finds a type that is recognized by a factory,
or it reaches the least-derived type. If no factory is found that
can create an instance, the run time throws
NoValueFactoryException.
If the value uses the "compact" format, Ice immediately raises
NoValueFactoryException.
The following order is used to locate a factory for a type:
The Ice run-time looks for a factory registered
specifically for the type.
If no instance has been created, the Ice run-time looks
for the default factory, which is registered with an empty type id.
If no instance has been created by any of the preceding
steps, the Ice run-time looks for a factory that may have been
statically generated by the language mapping for non-abstract classes.
Arguments:
factory -- The factory to add.
id -- The type id for which the factory can create instances, or an empty string for the default factory.
"""
raise NotImplementedError("method 'add' not implemented")
def find(self, id):
"""
Find an value factory registered with this communicator.
Arguments:
id -- The type id for which the factory can create instances, or an empty string for the default factory.
Returns: The value factory, or null if no value factory was found for the given id.
"""
raise NotImplementedError("method 'find' not implemented")
def __str__(self):
return IcePy.stringify(self, _M_Ice._t_ValueFactoryManager)
__repr__ = __str__
_M_Ice._t_ValueFactoryManager = IcePy.defineValue('::Ice::ValueFactoryManager', ValueFactoryManager, -1, (), False, True, None, ())
ValueFactoryManager._ice_type = _M_Ice._t_ValueFactoryManager
_M_Ice.ValueFactoryManager = ValueFactoryManager
del ValueFactoryManager
# End of module Ice
|