bthci/bthci2/CommandsEvents/generator/parameter.py
branchRCL_3
changeset 16 9f17f914e828
parent 0 29b1cd4cb562
equal deleted inserted replaced
14:f8503e232b0c 16:9f17f914e828
     1 # Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 # Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 # All rights reserved.
     2 # All rights reserved.
     3 # This component and the accompanying materials are made available
     3 # This component and the accompanying materials are made available
     4 # under the terms of "Eclipse Public License v1.0"
     4 # under the terms of "Eclipse Public License v1.0"
     5 # which accompanies this distribution, and is available
     5 # which accompanies this distribution, and is available
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
    17 def makeParameters(aParams):
    17 def makeParameters(aParams):
    18     param_str = ""
    18     param_str = ""
    19     
    19     
    20     for p in aParams:
    20     for p in aParams:
    21         param_str += p.toParameter() + ', '
    21         param_str += p.toParameter() + ', '
       
    22 
       
    23     return param_str[:-2]
       
    24     
       
    25 def makeOwnedParameters(aParams):
       
    26     param_str = ""
       
    27     
       
    28     for p in aParams:
       
    29         if p.Owned():
       
    30             param_str += p.toParameter() + ', '
       
    31 
       
    32     return param_str[:-2]
       
    33     
       
    34 def makeNonOwnedParameters(aParams):
       
    35     param_str = ""
       
    36     
       
    37     for p in aParams:
       
    38         if not p.Owned():
       
    39             param_str += p.toParameter() + ', '
    22 
    40 
    23     return param_str[:-2]
    41     return param_str[:-2]
    24 
    42 
    25 # Creates a ;\n\t separated string of parameters suitable for class member declarations.
    43 # Creates a ;\n\t separated string of parameters suitable for class member declarations.
    26 def makeMembers(aParams):
    44 def makeMembers(aParams):
   143             return 'EXPORT_C ' + self.iType.toAccessor('Command') + ' ' + aClass + '::' + self.getName() + '(TInt aIndex) const\n\t{\n\treturn ' + memberName + '[aIndex];\n\t}\n\n'
   161             return 'EXPORT_C ' + self.iType.toAccessor('Command') + ' ' + aClass + '::' + self.getName() + '(TInt aIndex) const\n\t{\n\treturn ' + memberName + '[aIndex];\n\t}\n\n'
   144 
   162 
   145     # Returns a string of the format 'iName = aName;'
   163     # Returns a string of the format 'iName = aName;'
   146     def memberAssignment(self):
   164     def memberAssignment(self):
   147         return 'i' + self.getName() + ' = a' + self.getName() + ';'
   165         return 'i' + self.getName() + ' = a' + self.getName() + ';'
       
   166         
       
   167     def Owned(self):
       
   168         return self.iArray != ''
       
   169     
       
   170