Examples¶
Retrieving a proxy¶
from armarx import RNGProviderComponentInterface
rng_provider = RNGProviderComponentInterfacePrx.get_proxy()
rng_provider.generateRandomInt()
Creating a proxy¶
#!/usr/bin/env python
import random
from armarx import RNGProviderComponentInterface
from armarx_core import ice_manager
class RNGProvider(RNGProviderComponentInterface):
def generateRandomInt(self, current=None):
r = int(random.random() * 1000)
return r
def main():
ice_manager.register_object(RNGProvider(), 'RNGProvider')
ice_manager.wait_for_shutdown()
if __name__ == '__main__':
main()