BArchivable Class Reference

#include <Archivable.h>

Inheritance diagram for BArchivable:

BBitmap BChoiceList BCursor BHandler BListItem BMailChain BMenuItem BNetAddress BNetBuffer BNetEndpoint BPicture BResourceItem BShape BTab BTranslator BTranslatorRoster List of all members.

Detailed Description

BArchivable is a protocol for archiving and unarchiving objects.

When you archive an object, you record its state into a BMessage that can be sent to another application, flattened and saved as a file, cached in memory, and so on. Unarchiving does the opposite: It takes a BMessage archive and turns it into a functioning object.
See also:
Archiving for more information on the BeOS archival system.


Public Member Functions

 BArchivable ()
virtual ~BArchivable ()
 BArchivable (BMessage *from)
virtual status_t Archive (BMessage *into, bool deep=true) const
virtual status_t Perform (perform_code d, void *arg)

Static Public Member Functions

static BArchivableInstantiate (BMessage *from)


Constructor & Destructor Documentation

BArchivable  ) 
 

Does nothing.

~BArchivable  )  [virtual]
 

Does nothing.Instantiate(

BArchivable BMessage from  ) 
 

Does nothing.


Member Function Documentation

status_t Archive BMessage data,
bool  deep = true
const [virtual]
 

The default implementation adds the name of the object's class to data's"class" field. Derived classes must override Archive() to augment this implementation by adding, to the BMessage, data that describes the current state of the object. Each implementation of this function should begin by incorporating the inherited version:

We'll assume that MyView inherits from BView. status_t MyView::Archive(BMessage *archive, bool deep) { BView::Archive(archive, deep); . . . }

If the class can be instantiated directly from a derived class, it should also add its name to the "class" array:

archive->AddString("class", "MyView");

The deep flag declares whether Archive() should include objects that "belong" to the archiving object. For example, a deep BView archive would include archived forms of the view's children.

Archive() should return B_OK if it's successful; otherwise, it should return B_ERROR or a more descriptive error code.

Reimplemented in BMailProtocolConfigView, BApplication, BCursor, BHandler, BLooper, LayoutHVGroup, LayoutManager, BSpinField, BStringView, BTextField, BDirectWindow, BAlert, BBitmap, BBox, BButton, BChannelControl, BChannelSlider, BCheckBox, BColorControl, BControl, BDragger, BListItem, BStringItem, BListView, BMenu, BMenuBar, BMenuField, BMenuItem, BSeparatorItem, BOutlineListView, BPicture, BPictureButton, BPopUpMenu, BRadioButton, BScrollBar, BScrollView, BSeparator, BShape, BShelf, BSlider, BSlideRule, BSpeedButton, BStatusBar, BStringView, BTab, BTabView, BTextControl, BTextListControl, BChoiceList, BStringChoiceList, BTextView, BView, BWindow, BMailChain, BNetAddress, BNetBuffer, BNetEndpoint, BPrintConfigView, BResourceItem, and BTranslatorRoster.

BArchivable * Instantiate BMessage archive  )  [static]
 

Derived classes should implement Instantiate() to return a new BArchivable object that was constructed from the BMessage archive.

Attention:
Instantiate() must return a BArchivable *, regardless of the actual class in which it's implemented.
This function depends on a constructor that can initialize the new object from the archive BMessage. See Instantiability for more information.

The default implementation returns NULL.

Reimplemented in BApplication, BCursor, BHandler, BLooper, LayoutHVGroup, LayoutManager, BSpinField, BStringView, BTextField, BDirectWindow, BAlert, BBitmap, BBox, BButton, BChannelSlider, BCheckBox, BColorControl, BControl, BDragger, BStringItem, BListView, BMenu, BMenuBar, BMenuField, BMenuItem, BSeparatorItem, BOutlineListView, BPicture, BPictureButton, BPopUpMenu, BRadioButton, BScrollBar, BScrollView, BSeparator, BShape, BShelf, BSlider, BSlideRule, BSpeedButton, BStatusBar, BStringView, BTab, BTabView, BTextControl, BTextListControl, BStringChoiceList, BTextView, BView, BWindow, BMailChain, BNetAddress, BNetBuffer, BNetEndpoint, BPrintConfigView, and BTranslatorRoster.

status_t Perform perform_code  d,
void *  arg
[virtual]
 

Reimplemented in BApplication, BCursor, BHandler, BLooper, BDirectWindow, BWindowScreen, BAlert, BBitmap, BBox, BButton, BCheckBox, BColorControl, BControl, BDragger, BListItem, BStringItem, BListView, BMenu, BMenuBar, BMenuField, BOutlineListView, BPicture, BPictureButton, BPopUpMenu, BRadioButton, BScrollBar, BScrollView, BShape, BShelf, BSlider, BStatusBar, BStringView, BTabView, BTextControl, BTextListControl, BTextView, BView, BWindow, BDirectGLWindow, and BPrintConfigView.


Copyright 2005 by yellowTAB GmbH, Be Inc., Palm Source Inc. and their respective legal successors
All rights reserved.