changed: disable boost std::atomic use by default
[opensg.git] / Tools / convScript / OperationBundle.py
blobfdbdb7011eb48c57d3118b19acd1ccf0fcfc10c4
2 from OperationRegistry import OperationRegistry
4 class OperationBundle:
5 """ Bundles a bunch of operations to be applied together.
6 """
8 #### member
9 # opList -- list of operations
11 def __init__(self):
12 self.opList = [];
14 # add an operation
15 def addOp(self, opName):
16 op = OperationRegistry.getRegisteredOp(opName);
18 if op == None:
19 print "ERROR: addOp called with unknown op \"%s\"" % opName;
21 op.addSelf(self);
23 # remove an operation
24 def subOp(self, opName):
25 op = OperationRegistry.getRegisteredOp(opName);
27 if op == None:
28 print "ERROR: subOp called with unknown op \"%s\"" % opName;
30 op.subSelf(self);
32 def applyBundle(self, driver):
33 for op in self.opList:
34 op.applyOp(driver);
36 ###############################
37 # Internal
39 # add op to the list of enabled ones (unless it already is in it)
40 def internal_addOp(self, op):
41 if op not in self.opList:
42 self.opList.append(op);
44 # remove op from the list of enables ones
45 def internal_subOp(self, op):
46 if op in self.opList:
47 self.opList.remove(op);