Ignore:
Timestamp:
Jul 18, 2015, 10:18:34 AM (4 years ago)
Author:
nmedfort
Message:

First attempt to intergrate 'generate_predefined_ucd_functions' into build process.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/function.h

    r4680 r4684  
    2222    }
    2323
    24     static inline bool classof(const void *) {
     24    static inline bool classof(void *) {
    2525        return false;
    2626    }
    2727
    28     static Prototype * Create(std::string name, const unsigned inputVariables, const unsigned outputVariables, const unsigned requiredStateSpace);
     28    static Prototype * Create(std::string name, const unsigned inputVariables, const unsigned outputVariables, const unsigned requiredStateSpace, void * functionPtr = nullptr);
    2929
    3030    const String * getName() const {
     
    4545    }
    4646
    47 protected:
    48     // Should only be modified by a pablo::Function after compilation
    49     void setRequiredStateSpace(const unsigned value) {
    50         mRequiredStateSpace = value;
     47    void * getFunctionPtr() const {
     48        return mFunctionPtr;
    5149    }
    5250
    53     Prototype(const PabloAST::ClassTypeId type, std::string && name, const unsigned numOfParameters, const unsigned numOfResults, const unsigned requiredStateSpace);
     51protected:
     52    Prototype(const PabloAST::ClassTypeId type, std::string && name, const unsigned numOfParameters, const unsigned numOfResults, const unsigned requiredStateSpace, void * functionPtr);
    5453protected:
    5554    const String * const    mName;
     
    5756    const unsigned          mNumOfResults;
    5857    unsigned                mRequiredStateSpace;
     58    void *                  mFunctionPtr;
    5959};
    6060
    61 inline Prototype * Prototype::Create(std::string name, const unsigned numOfParameters, const unsigned numOfResults, const unsigned requiredStateSpace) {
    62     return new Prototype(PabloAST::ClassTypeId::Prototype, std::move(name), numOfParameters, numOfResults, requiredStateSpace);
     61inline Prototype * Prototype::Create(std::string name, const unsigned numOfParameters, const unsigned numOfResults, const unsigned requiredStateSpace, void * functionPtr) {
     62    return new Prototype(PabloAST::ClassTypeId::Prototype, std::move(name), numOfParameters, numOfResults, requiredStateSpace, functionPtr);
    6363}
    6464
     
    7979    }
    8080
    81     static inline bool classof(const void *) {
     81    static inline bool classof(void *) {
    8282        return false;
    8383    }
     
    144144    }
    145145
     146    void setRequiredStateSpace(const unsigned value) {
     147        mRequiredStateSpace = value;
     148    }
     149
     150    void setFunctionPtr(void * functionPtr) {
     151        mFunctionPtr = functionPtr;
     152    }
     153
    146154    virtual ~PabloFunction() { }
    147155
Note: See TracChangeset for help on using the changeset viewer.