锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久青草婷婷精品综合日韩,欧美视频免费在线,亚洲韩国青草视频http://www.shnenglu.com/cheney-chen/category/6878.html learning symbian C++zh-cnMon, 19 May 2008 13:12:46 GMTMon, 19 May 2008 13:12:46 GMT60Name Conventions for Applications on Symbian OShttp://www.shnenglu.com/cheney-chen/articles/Name_Conventions_for_Applications_on_Symbian_OS.htmlcheneycheneySun, 27 Apr 2008 06:57:00 GMThttp://www.shnenglu.com/cheney-chen/articles/Name_Conventions_for_Applications_on_Symbian_OS.htmlhttp://www.shnenglu.com/cheney-chen/comments/48259.htmlhttp://www.shnenglu.com/cheney-chen/articles/Name_Conventions_for_Applications_on_Symbian_OS.html#Feedback1http://www.shnenglu.com/cheney-chen/comments/commentRss/48259.htmlhttp://www.shnenglu.com/cheney-chen/services/trackbacks/48259.htmlOverview

Applications on Symbian OS use a standard set of conventions to name their classes, structs, variables, functions, macros, enumerations, and constants. This topic explains the meaning of these conventions.

 

Class names 

Most class names are formed with a prefix letter C, T, R, or M. Briefly, the meaning of these is as follows: 

  • C: heap-allocated classes, that are derived from a base class CBase

  • T: value classes, that do not own any external object

  • R: resource classes, that contain handles to a real resource which is maintained elsewhere

  • M: interface classes, that define abstract protocol definitions that are implemented by derived classes

    Classes that consist solely of static member functions have no prefix letter. Beyond the prefix, the class name is usually a noun that indicates the purpose of the class.


    Struct names

    Structure types are considered as similar to T classes, as they should not own external objects, and are normally given names beginning with T (although some begin with S).


    Variable names

    Member variables names begin with i, e.g. iMember. This makes it easy to check that certain cleanup-related rules are being obeyed. Arguments names begin with a, e.g. aControl or aIndex. Local variables names have no initial letter. Global variables are usually avoided, but when used, their names begin with a capital letter.

    Symbian OS does not use Hungarian or any notation which attempts to include the variable type in its name: such notations are ugly, and become impossible to manage when there are several hundred classes in the system. They are irrelevant anyway: functions are usually so short that it is easy to see the types of variables defined in them, and class browsers provide a quick way to find the types of class members.


    Function names

    Functions names indicate what they do. They are usually verbs. One exception is getter functions: for a function which returns the value of a member variable, the function name is usually the name of the variable, without the leading i:

    inline RWindow& Window() const { return iWindow; };

    A corresponding setter function would include the word Set, e.g. SetWindow().

    To terminate functions because of error conditions, Symbian OS does not use standard C++ exception handling, but its own system called leaving (see Cleanup Support Overview). Any function that might leave has a name ending in ...L(). This makes the fundamental process of checking for errors easier. The new (ELeave) function might also leave. The fundamental leaving function is User::Leave(). Any function that contains any of these, and does not trap them, might itself leave, and should be coded with a trailing L in its name. If a function calls another which might leave, then its name should have the L suffix also.

    Associated with the leaving mechanism, is the cleanup stack, which allows memory allocated on the heap to be recovered when a leave occurs. An allocation or construction function which places data on the cleanup stack ends with ...LC(). For instance, many new, PushL(), ConstructL() sequences are encapsulated in a NewLC() function:

    CS* s=CS::NewLC(p1, p2);

    This allocates the object, initialises it, and leaves it on the cleanup stack. This process may leave (if only through the PushL()!), so such functions always include an L, and are therefore ...LC().

    A function which takes ownership of its object and destroys it has a name ending in ...D(). An example is the UI framework dialog protocol:

    CEikDialog* dialog=new (ELeave) CBossSettingsDialog;
    if (dialog->ExecuteLD(R_BOSS_SETTINGS_DIALOG))
        {
        // handle successful settings
        }

    The ExecuteLD() function includes second-phase construction, execution of the dialog and then destruction.


    Macro names

    Macro names are all capitalised, with underscores to separates words.


    Enumeration names

    Enumerations are named as follows:

    • as enumerations are types, they have the T prefix
    • enumeration members have the prefix E
    • type and members should have a meaningful, unambiguous name

    Enumerations should be scoped within the relevant class, so as not to pollute the global name space.

    An example of the declaration and use of an enumeration is as follows:

    class TDemo
        {
    public:
        enum TShape {EShapeRound, EShapeSquare};
        };

    TDemo::TShape shape=TDemo::EShapeSquare;



    Constant names

    Names of constants have a prefix K. For example,

    const TInt KMaxNameLength=0x20;



  • cheney 2008-04-27 14:57 鍙戣〃璇勮
    ]]>
    麻豆av久久av盛宴av| 久久久国产精华液| 韩国三级中文字幕hd久久精品| 狠狠色狠狠色综合久久| 97久久精品国产精品青草| 天天综合久久久网| 国产精品99久久久精品无码| 国产精品久久久久影院色| 久久久久久噜噜精品免费直播| 久久人做人爽一区二区三区| 久久亚洲综合色一区二区三区| 国产精品久久久久久五月尺| 日本精品久久久久中文字幕| 亚洲AV无码1区2区久久| 久久午夜综合久久| 久久香蕉一级毛片| 精品熟女少妇av免费久久| 久久亚洲精品国产亚洲老地址| 久久精品国产99国产精偷| 日韩乱码人妻无码中文字幕久久| 久久久久国产日韩精品网站| 大伊人青草狠狠久久| 久久国语露脸国产精品电影| 久久精品人妻一区二区三区| 久久久久综合网久久| 韩国免费A级毛片久久| 亚洲狠狠婷婷综合久久蜜芽| 国产欧美久久久精品影院| 久久伊人影视| 久久久久亚洲AV无码专区网站| 99久久精品无码一区二区毛片| 2020久久精品国产免费| 久久99国产精品99久久 | 国产精品久久久久久一区二区三区| 久久精品国产色蜜蜜麻豆| 久久婷婷人人澡人人爽人人爱| 欧美与黑人午夜性猛交久久久| 青春久久| 久久AV高潮AV无码AV| 东方aⅴ免费观看久久av| 中文字幕亚洲综合久久菠萝蜜|