Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion : Dynamic Pipelines #58

Open
yashhema opened this issue Feb 10, 2018 · 1 comment
Open

Suggestion : Dynamic Pipelines #58

yashhema opened this issue Feb 10, 2018 · 1 comment

Comments

@yashhema
Copy link

Hello,
I have pipeline defined in textfile like OperationA para1 para2|OperationB para1 para2 para3|OperationC para1 where OperationA takes 2 input parameters , OperationB takes 3 parameters

(I have already defined these operations as functions, all these functions have same returntype )

Can someone provide me pointers, how can I read this from text and create a pipeline dynamically in code for this.

(The operation names can vary , depending upon whats defined in text file)

@mr-j0nes
Copy link
Collaborator

Hi there, just another user here.

You might put all the possible operations in a std::map, then create a generic class that inherits from raft::kernel. That class could accept a method that will be any of the operations and then accept also a list of parameters.

The logic can be something like this:

// Define all possible operations
map m
loop possibleOperations
{
   m.insert("operationLabel", operationMethod)
}

// Parse text file
verctor v
loop readOperations
{
   new GenericKernel gk
   gk->setMethod(m.at(currentOperationLabel))
   loop parameters
   {
       gk->addParameter(parameter)
   }
   v.insert(gk)
}

// Build stream
raft::map m
GenericKernel prev = v(1)
loop v(from 2nd)
{
   m += prev >> curr
   prev = curr;  
}

Just an idea, hope it helps,
Cheers...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants