专用操作标记为 static,使同一文件中的其他操作能够访问它们。
例如,如果 close() 操作设置为专用,那么会在 Valve 对象的实施文件的前置声明部分中生成以下声明:
/* Forward declaration of protected methods */ /*## operation close() *\ static void close(Valve* const me);
/* Methods implementation */
static void close(Valve* const me) {
NOTIFY_OPERATION(me, &me, NULL, Valve, close, close(),
0, Default_Valve_close_SERIALIZE);
/*#[ operation close() */
/*#]*/
}
您可以使用 C_CG::Operation::ProtectedName 属性来控制专用操作的名称。该属性的缺省值 $opName 为专用操作使用用户指定的名称,例如 myName()。