Re: [AGENT++] replace value() problem

fock at agentpp.com fock at agentpp.com
Thu Jun 3 22:46:01 CEST 2004


May be you have to make sure that the row "r"
could be created (thus did not already exist)?

Do you really have at least three columns in that
row?

Best regards,
Frank

Blake Sorensen <blake.sorensen at digitalenvoy.net> schrieb am 02.06.2004,
22:01:26:
> I'm trying to reset the value of a table entry as each get request comes 
> in, but the application crashes when I try and reassign 'value' in the 
> overloaded get_request. Not sure what I'm doing wrong, I've based the 
> code off of the various examples. Everything works fine as long as I 
> don't try and reassign the value.
> 
> The MibLeaf in question:
> 
> class dbIsLoaded: public MibLeaf
> {
> public:
>      dbIsLoaded(const Oidx &oid, mib_access access);
>      virtual MibEntryPtr clone();
>      virtual ~dbIsLoaded();
>      virtual void get_request(Request *req, int ind);
> private:
>      DB   **databases;
> }
> 
> void dbIsLoaded::get_request(Request *req, int ind)
> {
>      int dbInd = (int)req->get_oid(ind).last();
> 
>      if (databases[dbInd]->isDBLoaded())
>      {
>          *((OctetStr*)value) = OctetStr("yes");
>      }
>      else
>      {
>          *((OctetStr*)value) = OctetStr("no");
>      }
> 
>      MibLeaf::get_request(req,ind);
> }
> 
> The leaf is added to the table with:
> //...
> add_col(new dbIsLoaded("3",READWRITE));
> //...
> 
> And the initial value sets fine with:
> // ...
> MibTableRow *r = st->add_row(ind);
> r->get_nth(2)->replace_value(new OctetStr("yes"));
> // ...
> 
> 
> Any suggestions would be greatly appreciated.
> 
> Blake Sorensen
> Software Engineer, Digital Envoy
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://agentpp.org/mailman/listinfo/agentpp



More information about the AGENTPP mailing list