Topic
2 replies Latest Post - ‏2013-07-31T08:03:30Z by aj_is_here
aj_is_here
aj_is_here
14 Posts
ACCEPTED ANSWER

Pinned topic How to get parameter in Primitive Operator

‏2013-05-22T03:06:01Z |

Good Day,

 

Does anyone have an idea on how to get parameter in C or C++ in a primitive operator?

 

Example:

SPL

composite StreamsGetParameter

{

     graph

        stream<rstring teststring> Output = PrimitiveOperator()

         {

             param

                 customArchiveDir : "/home/stream";

                 sleepTime : 10

         }

}

 

CGT:

/ / constructor

MY_OPERATOR::MY_OPERATOR()

{
     char customDir[512] = getParameter("customArchiveDir");

     int     sleepTimer   = getParameter("sleepTime");
}

 

Appreciate your help guys.

 

Thank You :D

  • This reply was deleted by AnirudhT. 2013-06-13T13:26:22Z.
  • This reply was deleted by AnirudhT. 2013-06-13T23:23:50Z.
  • This reply was deleted by AnirudhT. 2013-06-13T13:26:30Z.
  • AnirudhT.
    AnirudhT.
    1 Post
    ACCEPTED ANSWER

    Re: How to get parameter in Primitive Operator

    ‏2013-06-13T13:27:37Z  in response to aj_is_here

    Hey AJ,

    I believe there is an example of this in the SPL for beginners package. Its an all-round useful package to have so I've attached it for you. The particular example you are looking for is "035_c++_primitive_operator_at_work".  The jist of it is you need to do something like this in the constructor:

    <%

    my $sleepTimer = "$model->getParameterByName("sleepTime");"

    %>

    Good luck,

    Anirudh

    Attachments

  • aj_is_here
    aj_is_here
    14 Posts
    ACCEPTED ANSWER

    Re: How to get parameter in Primitive Operator

    ‏2013-07-31T08:03:30Z  in response to aj_is_here

    Thanks :)