Regarding MibTable::commit_set_request

Frank Fock Frank.Fock____t-online.de
Mon May 12 20:28:29 CEST 2003


Cheng,

Your code snippet is not a solution to your problem
and I do not think that a solution exists. I see the
following problems:

1. What happens when a manager creates a row in your
table and simultaneously setting another object in
your agent?
2. When the manager sets 5 columns but there are only
4 then the agent *must* return an error!
3. What happens when the order of requests is not the
one you expect?

Best regards,
Frank Fock

Cheng Chaoting wrote:
> Dear All,
>  
> In MibTable::commit_set_request function,do we need to truncate the 
> redundant columns?Suppose,for one table,every row has 4 columns,when 
> manager wants to create one row,but it inputs 5 columns,so,i think agent 
> should truncate the last column.How can we implement it?
>  
> I wrote the following code:
>  
> int 
> imap_northbound_common_hwIMAPNorthboundCommonManagerInformationEntry::commit_set_request(Request* 
> req, int ind)
> {
>  //--AgentGen 
> BEGIN=hwIMAPNorthboundCommonManagerInformationEntry::commit_set_request
>  //--AgentGen END
>  
>  int ivbSize = req->subrequests();
>  int iMaxVbsAllowed = ivbSize % 4;
>  iMaxVbsAllowed = ivbSize - iMaxVbsAllowed;
>  req->trim_request(iMaxVbsAllowed); //here i use trim_request to 
> truncate the redundant columns
>  
>  for(int i = ind; i < iMaxVbsAllowed; i = i + 4)
>  {
>       Oidx oidRowIndex = 
> imap_northbound_common_hwIMAPNorthboundCommonManagerInformationEntry::instance->index(req->get_oid(i));
>       int iCmd;
>       req->get_value(i).get_value(iCmd);
>  
>       if(iCmd == rowDestroy)
>       ............... 
>  
>  }
> }
>  
> When Rowstatus is CreateAndGo,it works fine,but if Rowstatus is 
> RowDestroy,agent doesn't execute the 'for' loop,because 
> req->subrequests() is 1,so iMaxVbsAllowed is 0.
>  
>  
> Does anybody have some solutions?
>  
> TIA.
>  
>  
> With regards,
> Cheng Chaoting






More information about the AGENTPP mailing list