mazurov
11/19/2010 - 7:53 AM

notwork.py

# Using self.cN
class Test():
    def __init__(self):
        self.c1 = Hlt.Candidate()
        self.c2 = Hlt.Candidate()
        self.c3 = Hlt.Candidate()

        self.candidates = Hlt.Candidate.ConstVector()
        self.candidates.push_back (self.c1)
        self.candidates.push_back (self.c2)
        self.candidates.push_back (self.c3)
        #self.c1.addToStages(self.stage1)
        #self.c2.addToStages(self.stage2)
        #self.c3.addToStages(self.stage3)

    def test(self):
        for c in self.candidates:
            print c
# t.test() - segmentation fault. Using push_back(c1). cN local for __init__.
class Test():
    def __init__(self):
        c1 = Hlt.Candidate()
        c2 = Hlt.Candidate()
        c3 = Hlt.Candidate()

        self.candidates = Hlt.Candidate.ConstVector()
        self.candidates.push_back (c1)
        self.candidates.push_back (c2)
        self.candidates.push_back (c3)
        #self.c1.addToStages(self.stage1)
        #self.c2.addToStages(self.stage2)
        #self.c3.addToStages(self.stage3)

    def test(self):
        for c in self.candidates:
            print c