准则1可以通过类型检查得到保证,如果在函数中有任何静态存储声明,则抛出错误消息。
Guideline 1 can be ensured by type checking and throwing an error message if there is any static storage declaration in the function.
然后,您可以将这些设置保存在类的静态成员中,以便后续的消息可以使用其值。
You can then store these Settings in static members of the class, making the value available to subsequent messages.
清单 1 中的处理程序代码将读取消息主体,并将其赋值给静态变量。
The handler code in Listing 1 reads the message body and assigns it to a static variable.
应用推荐