Notes C++ API 框架

Architecture of the C++ API 

The C++ API architecture is based on a conceptual containment model, where the containment model defines an object's scope. A container always creates objects it contains. For example, an LNNotesSession object creates LNDatabase objects, and an LNDatabase object creates LNDocument objects.
The following figure shows a combined inheritance and containment hierarchy for commonly-used classes in the C++ API:

Closing a container object automatically closes all contained objects. For example, if you create a database object, use a member function to create a document, and then close the database, the document also closes. Consequently, you should be careful to save changes to contained objects before closing the object that contains them.
Note  If you don't close a container object (for example, LNViewFolder, LNDatabase, LNNote, LNDocument, or LNAgent) before it goes out of scope, it closes automatically at some point. However, for efficiency, you should close resources as soon as you are finished with them. That way, you can be sure that memory associated with objects is freed immediately.
The following table shows the complete inheritance hierarchy of the C++ API, with derived classes indented under their parent class. Each class name is a link to the Reference Guide description of the class. Note that most classes inherit from one of two abstract base classes, and that the C++ API does not use multiple inheritance.

LNSmartPtr
      LNACLEntry
      LNAction
      LNActiveObjectParameter
      LNActiveObjectParameters
      LNAdministrationProcess
      LNCompositeData
      LNDatabase
            LNCalendar
      LNDatabaseArray
      LNFontStyle
      LNFormFieldArray
      LNFormula
      LNFrame
      LNItem
            LNActions
            LNAttachment
            LNDatetimes
            LNFontTable
            LNNumbers
            LNOLEObject
            LNRichText
            LNText
      LNItemArray
            LNAttachmentArray
            LNOLEObjectArray
      LNJavaScript
      LNLotusScript
      LNMessageQueue
      LNNote
            LNAgent
            LNAppletResource
            LNDocument
                  LNCalendarEntry
                  LNMailMessage
            LNForm 
            LNFrameset
            LNImageResource
            LNNavigator
            LNOutline
            LNPage
            LNScriptLibrary
            LNSharedField
            LNSubform
            LNViewFolder
      LNNoteArray
            LNAgentArray
            LNAppletResourceArray
            LNCalendarEntryArray
            LNDocumentArray
            LNFormArray
            LNFramesetArray
            LNImageResourceArray
            LNNavigatorArray
            LNOutlineArray
            LNPageArray
            LNScriptLibraryArray
            LNSharedFieldArray
            LNSubformArray
            LNViewFolderArray
      LNParagraphStyle
            LNNamedStyle
      LNRTCursor
      LNRTObject
            LNBitmap
            LNBitmapColorTable
            LNBitmapPatternTable
            LNBitmapSegment
            LNBitmapTransparencyTable
            LNMacMetafileSegment
            LNMetafile
                  LNCGMMetafile
                  LNMacMetafile
                  LNPMMetafile
                  LNWinMetafile
            LNPMMetafileSegment
            LNProfileDocument
                  LNCalendarProfileDocument
            LNRTContainer
                  LNHotspot
                        LNActionHotspot
                       LNComputedText
                        LNFormulaPopup
                        LNLinkHotspot
                        LNTextPopup
                        LNURLLink
                 LNSection
                  LNStylizedText
                  LNTable
                  LNTableCell
            LNRTElement
                  LNActiveObject
                       LNRTJavaApplet
                  LNAnchorLocation
                  LNButton
                  LNCompositeData
                  LNDatabaseLink
                        LNViewLink
                              LNDocumentLink
                                    LNAnchorLink
                  LNFormField
                        LNKeywordsField
                        LNNamesField
                  LNGraphic
                  LNHorizontalRule
                  LNRTEmbeddedObject
                        LNRTAttachment
                  LNRTComputedSubform
                  LNRTOLEObject
                  LNRTSubform
            LNWinMetafileSegment
      LNSearch
            LNSearchByAuthor
            LNSearchByDate
            LNSearchByDateInField
            LNSearchByFieldsInForm
            LNSearchByFormUsed
            LNSearchByNumberInField
            LNSearchByPlainText
            LNSearchByTextInField
            LNSearchByTextTerms
            LNSearchInFolder
      LNSearches
      LNSimpleAction
            LNSimpleDatabaseAction
            LNSimpleFieldsInFormAction
            LNSimpleFolderAction
            LNSimpleModifyFieldAction
            LNSimpleRunAgentAction
            LNSimpleRunFormulaAction
            LNSimpleSendMailAction
            LNSimpleSendNewsletterAction
            LNSimpleSendReplyAction
      LNSimpleActions
      LNSimpleFieldValue
      LNString
      LNTabs
      LNVFColumn
      LNVFEntry
      LNVFNavigator

LNNotesClass
      LNACL
      LNACLEntryArray
      LNACLRoleArray
      LNCertifier
      LNChar
      LNCreateDatabaseOptions
      LNDatetime
      LNDatetimeFormat
      LNDatetimeRange
      LNDatetimesElement
      LNFrameSplitOptions
      LNFTIndexStatistics
      LNFTSearchOptions
      LNHTMLTags
      LNIDFile
      LNInternational
      LNLogEntry
     LNNamedElement
      LNNotesSession
      LNNumberFormat
      LNNumbersElement
      LNRegistrationOptions
      LNReplicationFileStatistics
      LNReplicationOptions
      LNReplicationStatistics
      LNSearchOptions
      LNServerAddin
      LNTextElement
      LNVFFindKey
      LNVFFindKeys
      LNVFFindOptions
      LNVFPosition

 

LNAgentJava
LNAgentRunData

LNColor
LNILockBytes

LNIStorage
LNNumber

As you would expect, parent classes in the C++ API represent generic Notes objects, while derived classes represent increasingly specialized objects. Your applications will be easier to write if you use derived classes wherever possible, since they provide access to API functions specifically designed to deal with Notes objects of particular types. For example, LNRichText::GetText returns a string representing the text of a rich text item in a note. If you used LNItem (the parent of LNRichText) to represent the item instead, you would have to work harder to get that string.
In general, use generic classes, such as LNItem or LNNote, when you don't care about the type of the actual object you're processing, or when you are manipulating an object of a type currently unsupported by the API.
You cannot directly use LNNotesClass or LNSmartPtr, since they are abstract classes.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

jiangxng

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值