[AGENT++] A few questions on shared tables

michael.carr at bt.com michael.carr at bt.com
Mon Apr 23 19:07:51 CEST 2007


Thanks Frank, I see what you mean.  I think I'll be looking to call
another classes function that will be acting as our cache, it'll be this
that will contain the different data per application.

What about changes to the data being reflected when a "get" is
requested?  Should this be done in the empty "update" function created
by AgenPro 2?  (Again it I would be looking to access the data from my
cache class.)  If yes how (i.e. what function calls are needed) do you
do this?  

Sorry if these are simple basic questions but I can't see anything like
it in the examples (point me to one if there is) or the documentation.

Thanks,
Mike

-----Original Message-----
From: Frank Fock [mailto:fock at agentpp.com] 
Sent: Friday, April 20, 2007 8:36 PM
To: Carr,M,Michael,JGFTY C
Cc: agentpp at agentpp.org
Subject: Re: [AGENT++] A few questions on shared tables

Hi Mike,

You can create a single subclass of the generated AgentXSharedTable that
serves for all sub-agents. Since the row_added method provides the index
OID of the registered row, you can use that information to fetch the
values from an internal cache that has been filled from the previously
by calling a method of your subclass.

Hope this helps.

Best regards,
Frank

michael.carr at bt.com wrote:
> Hi all,
> 
> I've used MIB Designer to create a simple table, then used AgenPro 2 
> to generate some subagent code.
> 
> I assume that the agent.cpp file located in the
> agentX++\agen\subagent\src is skeleton subagent code and so should be
> used with the code generated by AgenPro2, is this correct?
> 
> Similarly, the agent.cpp file located in the agentX++\agen\master\src 
> is skeleton master code?
> 
> On page 28 of the AgentX document it says that for shared tables the 
> 'row_added' method has to be overridden in order to set (or 
> initialise) the values of the new row.  Since I'll be running several 
> subagents that register a single row in my shared table, they will be 
> using different data in their rows.  Given what the document says, it 
> would mean that I would have to override the function for each 
> subagent which would lead me down the route of deriving a new class 
> for each subagent based on the class generated by AgenPro 2 for my
table, which seems a bit overkill.
> Is that correct or is there another way it should be done?
> 
> Once the row has been added to the table, one or two of the values it 
> contains (the columns?) may change within the subagent.  How do I 
> actually change those values?  (Some simple example code would be 
> appreciated :-)
> 
> Cheers,
> Mike
> 
> 
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the AGENTPP mailing list