Ignore:
Timestamp:
07/24/15 16:40:05 (9 years ago)
Author:
rlacroix
Message:

Field: Avoid some heap allocations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/file.hpp

    r645 r651  
    5353         enum EEventId 
    5454         { 
    55            EVENT_ID_ADD_FIELD=0,EVENT_ID_ADD_FIELD_GROUP, EVENT_ID_ADD_VARIABLE, 
     55           EVENT_ID_ADD_FIELD, EVENT_ID_ADD_FIELD_GROUP, EVENT_ID_ADD_VARIABLE, 
    5656           EVENT_ID_ADD_VARIABLE_GROUP, EVENT_ID_CREATE_ENABLED_FIELDS 
    57          } ; 
     57         }; 
    5858 
    5959         typedef CFileAttributes RelAttributes; 
     
    6262         /// Constructeurs /// 
    6363         CFile(void); 
    64          explicit CFile(const StdString & id); 
    65          CFile(const CFile & file);       // Not implemented yet. 
    66          CFile(const CFile * const file); // Not implemented yet. 
     64         explicit CFile(const StdString& id); 
     65         CFile(const CFile& file);       // Not implemented yet. 
     66         CFile(const CFile* const file); // Not implemented yet. 
    6767 
    6868         /// Destructeur /// 
     
    8484      public : 
    8585         // Some functions to verify state of file 
    86          bool isSyncTime(void) ; 
    87          bool checkSplit(void) ; 
    88          bool checkSync(void) ; 
    89          void checkFile(void) ; 
    90          void initFile(void) ; 
     86         bool isSyncTime(void); 
     87         bool checkSplit(void); 
     88         bool checkSync(void); 
     89         void checkFile(void); 
     90         void initFile(void); 
    9191 
    9292         /// Mutateurs /// 
     
    9999         void createHeader(void); 
    100100         void openInReadMode(void); 
    101          void close(void) ; 
     101         void close(void); 
    102102 
    103103         // Some processing on file 
    104104         void solveFieldRefInheritance(bool apply); 
    105          void processEnabledFile(void) ; 
     105         void processEnabledFile(void); 
    106106         void solveAllRefOfEnabledFields(bool sendToServer); 
    107107         void buildFilterGraphOfEnabledFields(CGarbageCollector& gc); 
     
    110110 
    111111         // Add component into file 
    112          CField* addField(const string& id="") ; 
    113          CFieldGroup* addFieldGroup(const string& id="") ; 
    114          CVariable* addVariable(const string& id="") ; 
    115          CVariableGroup* addVariableGroup(const string& id="") ; 
     112         CField* addField(const string& id = ""); 
     113         CFieldGroup* addFieldGroup(const string& id = ""); 
     114         CVariable* addVariable(const string& id = ""); 
     115         CVariableGroup* addVariableGroup(const string& id = ""); 
    116116 
    117117         // Send info to serever 
    118118         void sendEnabledFields(); 
    119          void sendAddField(const string& id="") ; 
    120          void sendAddFieldGroup(const string& id="") ; 
     119         void sendAddField(const string& id = ""); 
     120         void sendAddFieldGroup(const string& id = ""); 
    121121         void sendAddAllVariables(); 
    122          void sendAddVariable(const string& id="") ; 
    123          void sendAddVariableGroup(const string& id="") ; 
     122         void sendAddVariable(const string& id = ""); 
     123         void sendAddVariableGroup(const string& id = ""); 
    124124 
    125125         // Receive info from client 
    126          static void recvAddField(CEventServer& event) ; 
    127          void recvAddField(CBufferIn& buffer) ; 
    128          static void recvAddFieldGroup(CEventServer& event) ; 
    129          void recvAddFieldGroup(CBufferIn& buffer) ; 
    130          static void recvAddVariable(CEventServer& event) ; 
    131          void recvAddVariable(CBufferIn& buffer) ; 
    132          static void recvAddVariableGroup(CEventServer& event) ; 
    133          void recvAddVariableGroup(CBufferIn& buffer) ; 
     126         static void recvAddField(CEventServer& event); 
     127         void recvAddField(CBufferIn& buffer); 
     128         static void recvAddFieldGroup(CEventServer& event); 
     129         void recvAddFieldGroup(CBufferIn& buffer); 
     130         static void recvAddVariable(CEventServer& event); 
     131         void recvAddVariable(CBufferIn& buffer); 
     132         static void recvAddVariableGroup(CEventServer& event); 
     133         void recvAddVariableGroup(CBufferIn& buffer); 
    134134 
    135135         // Dispatch event 
    136          static bool dispatchEvent(CEventServer& event) ; 
     136         static bool dispatchEvent(CEventServer& event); 
    137137 
    138138      public: 
     
    144144      public: 
    145145         /// Traitements /// 
    146          virtual void solveDescInheritance(bool apply, const CAttributeMap * const parent = 0); 
     146         virtual void solveDescInheritance(bool apply, const CAttributeMap* const parent = 0); 
    147147 
    148148          /// Autres /// 
    149          virtual void parse(xml::CXMLNode & node); 
     149         virtual void parse(xml::CXMLNode& node); 
    150150         virtual StdString toString(void) const; 
    151151      public: 
    152152 
    153          CDate* lastSync ; 
    154          CDate* lastSplit ; 
     153         CDate lastSync; 
     154         CDate lastSplit; 
    155155         int nbAxis, nbDomains; 
    156          bool isOpen ; 
    157          bool allDomainEmpty ; 
    158          MPI_Comm fileComm ; 
     156         bool isOpen; 
     157         bool allDomainEmpty; 
     158         MPI_Comm fileComm; 
    159159 
    160160      private : 
    161161         /// Propriétés privées /// 
    162162         CFieldGroup* vFieldGroup; 
    163          CVariableGroup* vVariableGroup ; 
     163         CVariableGroup* vVariableGroup; 
    164164         boost::shared_ptr<CDataOutput> data_out; 
    165165         boost::shared_ptr<CDataInput> data_in; 
     
    167167 
    168168      public: 
    169         //         virtual void toBinary  (StdOStream & os) const; 
    170         //         virtual void fromBinary(StdIStream & is); 
     169        //         virtual void toBinary  (StdOStream& os) const; 
     170        //         virtual void fromBinary(StdIStream& is); 
    171171 
    172172   }; // class CFile 
Note: See TracChangeset for help on using the changeset viewer.