On 20/09/06, Graeme Wilson <[EMAIL PROTECTED]> wrote: > However once get_first/get_next has finished, the table_handler is > called to return the data. > Should I copy the required row of data found in get_first/get_next (into > my_data_context?) so that when the table_handler is called it is > guaranteed to be still pointing to the data
What the handler needs is "some way" of retrieving the data for a particular row. This is the role of 'my_data_context'. The details of "some way" are up to you. The most common approach is to have this variable point directly to the full contents of the row (e.g. as an entry within a linked list), but that's not the only way to handle this. You could equally well pass a database lookup key, or the index into some global array, or a kernel memory address. The vital thing is that there's some way to take this value, and retrieve the contents of the corresponding row. If you're concerned about the underlying table data changing underneath your feet, then one possibillity might be to load a copy of the table into the agent, and work with that copy instead. Such an approach means that the information reported by the agent is slightly out of date, but at least it's consistent and stable. The agent comes with a "cache helper" designed for this precise model of working. Dave ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
