Changeset 6207


Ignore:
Timestamp:
Nov 21, 2018, 12:03:58 PM (3 months ago)
Author:
cameron
Message:

Generic callback signals

Location:
icGREP/icgrep-devel/icgrep
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r6206 r6207  
    7070
    7171SET(KERNEL_SRC kernels/attributes.cpp kernels/binding.cpp kernels/relationship.cpp kernels/processing_rate.cpp)
    72 SET(KERNEL_SRC ${KERNEL_SRC} kernels/kernel.cpp kernels/streamset.cpp kernels/multiblock_kernel.cpp kernels/block_kernel.cpp)
     72SET(KERNEL_SRC ${KERNEL_SRC} kernels/kernel.cpp kernels/streamset.cpp kernels/multiblock_kernel.cpp kernels/block_kernel.cpp kernels/callback.cpp)
    7373SET(KERNEL_SRC ${KERNEL_SRC} kernels/pipeline/pipeline_kernel.cpp kernels/pipeline/pipeline_builder.cpp)
    7474SET(KERNEL_SRC ${KERNEL_SRC} kernels/source_kernel.cpp kernels/s2p_kernel.cpp kernels/deletion.cpp kernels/swizzle.cpp kernels/p2s_kernel.cpp kernels/stdout_kernel.cpp kernels/hex_convert.cpp)
  • icGREP/icgrep-devel/icgrep/grep/grep_engine.cpp

    r6204 r6207  
    99#include <boost/filesystem.hpp>
    1010#include <UCD/resolve_properties.h>
     11#include <kernels/callback.h>
    1112#include <kernels/charclasses.h>
    1213#include <kernels/cc_kernel.h>
     
    7879using Alphabets = ICGrepKernel::Alphabets;
    7980   
    80 extern "C" void signal_dispatcher(intptr_t callback_object_addr, unsigned signal) {
    81     reinterpret_cast<GrepCallBackObject *>(callback_object_addr)->handle_signal(signal);
    82 }
    83    
    8481void GrepCallBackObject::handle_signal(unsigned s) {
    8582    if (static_cast<GrepSignal>(s) == GrepSignal::BinaryFile) {
     
    255252        ByteStream = P->CreateStreamSet(1, 8);
    256253        Kernel * binaryCheckK = P->CreateKernelCall<AbortOnNull>(SourceStream, ByteStream, callbackObject);
    257         mGrepDriver.LinkFunction(binaryCheckK, "signal_dispatcher", signal_dispatcher);
     254        mGrepDriver.LinkFunction(binaryCheckK, "signal_dispatcher", kernel::signal_dispatcher);
    258255    } else {
    259256        llvm::report_fatal_error("Binary mode not supported.");
  • icGREP/icgrep-devel/icgrep/grep/grep_engine.h

    r6205 r6207  
    88#define GREP_ENGINE_H
    99#include <grep_interface.h>
    10 //#include <kernels/streamset.h>
     10#include <kernels/callback.h>
    1111#include <cc/multiplex_CCs.h>
    1212#include <string>
     
    3333enum GrepSignal : unsigned {BinaryFile};
    3434
    35 class GrepCallBackObject {
    36 public:
    37     GrepCallBackObject() : mBinaryFile(false) {}
     35class GrepCallBackObject : public kernel::SignallingObject {
     36public:
     37    GrepCallBackObject() : SignallingObject(), mBinaryFile(false) {}
    3838    virtual ~GrepCallBackObject() {}
    3939    virtual void handle_signal(unsigned signal);
     
    5151};
    5252
    53 extern "C" void signal_dispatcher(intptr_t callback_object_addr, unsigned signal);
    54    
    5553extern "C" void accumulate_match_wrapper(intptr_t accum_addr, const size_t lineNum, char * line_start, char * line_end);
    5654
Note: See TracChangeset for help on using the changeset viewer.