Changeset 3619

Show
Ignore:
Timestamp:
05/02/07 16:36:52 (6 years ago)
Author:
DrewCormier
Message:

writeGetPort method has been replaced

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • WaveDev/trunk/WaveDev/wavedev/generate/templates/py_comp/genStructure.py

    r3617 r3619  
    380380    ts = " "*4 + "queue_size = DEFAULT_QUEUE_BLOCK_SIZE;\n\n" + " "*4 + "component_alive = true;\n\n" + " "*4 + "naming_service_name = label;\n"; output.write(ts) 
    381381 
    382   def writeGetPort(self,output,c): 
    383     """ This function writes the getPort functionality to the component cpp file""" 
    384     inCount = 0; outCount=0; 
    385     flag = True 
    386     for x in c.ports: 
    387         if x.type == "Provides": 
    388             if flag: 
    389                 ts = " "*4 + 'if (strcmp(_id,"' + x.name + '") == 0) {\n' 
    390             else: 
    391                 ts = " "*4 + 'else if (strcmp(_id,"' + x.name + '") == 0) {\n' 
    392             output.write(ts) 
    393 #            ts = " "*8 + "return inPort" + str(inCount) + "_var;\n" 
    394             ts = " "*8 + "return " + x.interface.nameSpace + "::" + x.interface.name 
    395             ts += "::_duplicate(inPort" + str(inCount) + "_var);\n" 
    396             ts += " "*4 + "}\n" 
    397             output.write(ts) 
    398             inCount += 1 
    399     ts = "\n"; output.write(ts) 
    400     for x in c.ports: 
    401         if x.type == "Uses": 
    402             if flag: 
    403                 ts = " "*4 + 'if (strcmp(_id,"' + x.name + '") == 0) {\n' 
    404             else: 
    405                 ts = " "*4 + 'else if (strcmp(_id,"' + x.name + '") == 0) {\n' 
    406             output.write(ts) 
    407             ts = " "*8 + "outPort" + str(outCount) + "_active = true;\n" 
    408             ts += " "*8 + "return CF::Port::_duplicate(outPort" + str(outCount) + "_var);\n" 
    409             ts += " "*4 + "}\n" 
    410             output.write(ts) 
    411             outCount += 1 
    412     ts = "\n"; output.write(ts) 
    413     ts = " "*4 + 'return NULL;\n'; output.write(ts) 
    414382     
    415383  def writeDelPort(self,output,c):