Skip to content
Snippets Groups Projects
Commit 6addd484 authored by ptangu01's avatar ptangu01
Browse files

change Class name

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/trunk@231 b32b6428-25c9-4566-ad07-03861ab6144f
parent 65e42e91
Branches
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ from xAAL.tools import runActions
from collections import defaultdict
from time import time
class memory():
class Memory():
def __init__(self,timeout=0,cacheLevel=10):
self.__timeout = timeout #timeout in seconds
......@@ -88,11 +88,11 @@ class memory():
self.__cache.clear()
class cacheDevice(XAALDevice):
class CacheDevice(XAALDevice):
def __init__(self,address):
XAALDevice.__init__(self,"db.Cache",address,None)
self._cache = memory(timeout=60,cacheLevel=10)
self._cache = Memory(timeout=60,cacheLevel=1)
def cacheDevice(self,msg):
body = msg.getBody()
......@@ -128,13 +128,12 @@ class cacheDevice(XAALDevice):
for value in values:
print value
getCacheWithDevice.exposed = True
getCacheWithDevice.exposed = False
def getLastCacheWithDevice(self,address):
values = self._cache.get(address)
if values:
body = values[-1]
print body
return body
getLastCacheWithDevice.exposed = True
......@@ -171,7 +170,7 @@ def run(eng):
timer.start()
cache = cacheDevice(address = 'ff57b403-d0c6-490e-86cc-4c6664223aab')
cache = CacheDevice(address = 'ff57b403-d0c6-490e-86cc-4c6664223aab')
eng = XAALEngine()
eng.registerDevice(cache)
eng.registerCallBackHandler(cache.callBack)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment