[AGENT++] code puzzles

Frank Fock fock at agentpp.com
Fri Jun 9 13:02:17 CEST 2006


Hi Shaw,

You can safely remove the "#ifdef WIN32 .. #else" code
from notification_log_mib.cpp. This code has been
introduced at a time where the DateAndTime class was
not available for WIN32 and I have forgotten to remove
these exceptions when I implemented DateAndTime for
windows. The next release of AGENT++ (to be released
next week) will include this fix.

Best regards,
Frank

xiao.zhibin at zte.com.cn wrote:
> Hi everyOne:
> Today, I have taken a look at notification_log_mib.cpp.When I came to the 
> nlmLogEntry function,I was confused by the code as below
> nlmLogEntry::nlmLogEntry():
> 
>    MibTable(oidNlmLogEntry, indNlmLogEntry, 2)
> {
>         // This table object is a singleton. In order to access it use
>         // the static pointer nlmLogEntry::instance.
>         instance = this;
> 
>         add_col(new MibLeaf(colNlmLogTime, READONLY, new TimeTicks()));
>         add_col(new MibLeaf(colNlmLogDateAndTime, READONLY, new 
> OctetStr()));
>         add_col(new MibLeaf(colNlmLogEngineID, READONLY, new OctetStr()));
>         add_col(new MibLeaf(colNlmLogEngineTAddress, READONLY, new 
> OctetStr()));
>         add_col(new MibLeaf(colNlmLogEngineTDomain, READONLY, new 
> Oid1()));
>         add_col(new MibLeaf(colNlmLogContextEngineID, READONLY, new 
> OctetStr()));
>         add_col(new MibLeaf(colNlmLogContextName, READONLY, new 
> OctetStr()));
>         add_col(new MibLeaf(colNlmLogNotificationID, READONLY, new 
> Oid1()));
> 
>         //--AgentGen BEGIN=nlmLogEntry::nlmLogEntry
> #ifdef _WIN32
>         generator.get_nth(1)->set_access(NOACCESS);
> #else
>         replace_col(nNlmLogDateAndTime,
>                     new DateAndTime(colNlmLogDateAndTime, READONLY, 
>                                     VMODE_DEFAULT));
>         nlmConfigLogEntry::instance->add_listener(this);
> #endif 
>         //--AgentGen END
> 
> According to the RFC, I came to know Table nlmLogEntry should regeister 
> itself as a listener of table nlmConfigEntry,
> But seen from the current code ,I felt that it dosen't work in that way 
> under the platform of MS windows,since the usage of 
> ifdef _WIN32
> ...
> #else
> ...
> #endif
> 
> I really hope someone  will offer me a detailed explaination to theses 
> lines of coding.
> Thanks in Advance.
> 
> SHAW
> 
> }
> 
> 
> 
> ******************************
> tel:0755-26773000-6227
> mobile:13794495928
> ******************************
> 
> --------------------------------------------------------
> ZTE Information Security Notice: The information contained in this mail is solely property of the sender's organization. This mail communication is confidential. Recipients named above are obligated to maintain secrecy and are not permitted to disclose the contents of this communication to others.
> This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the originator of the message. Any views expressed in this message are those of the individual sender.
> This message has been scanned for viruses and Spam by ZTE Anti-Spam system.
> _______________________________________________
> 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