Archivable.h

Go to the documentation of this file.
00001 /******************************************************************************
00002 /
00003 /   File:           Archivable.h
00004 /
00005 /   Description:    BArchivable mix-in class defines the archiving
00006 /                   protocol.  Also some global archiving functions.
00007 /
00008 /   Copyright 1993-98, Be Incorporated
00009 /
00010 ******************************************************************************/
00011 
00012 #ifndef _ARCHIVABLE_H
00013 #define _ARCHIVABLE_H
00014 
00015 #include <BeBuild.h>
00016 #include <SupportDefs.h>
00017 #include <image.h>
00018 
00019 class BMessage;
00020 
00021 /*--------------------------------------------------------------------*/
00022 /*----- BArchivable class --------------------------------------------*/
00023 class BArchivable {
00024 public:
00025                     BArchivable();
00026 virtual             ~BArchivable(); 
00027 
00028                     BArchivable(BMessage *from);
00029 virtual status_t    Archive(BMessage *into, bool deep = true) const;
00030 static  BArchivable *Instantiate(BMessage *from);
00031 
00032 /*----- Private or reserved ---------------*/
00033 virtual status_t    Perform(perform_code d, void *arg);
00034 
00035 private:
00036 
00037 virtual void        _ReservedArchivable1();
00038 virtual void        _ReservedArchivable2();
00039 virtual void        _ReservedArchivable3();
00040 
00041         uint32      _reserved[2];
00042 };
00043 
00044 
00045 /*----------------------------------------------------------------*/
00046 /*----- Global Functions -----------------------------------------*/
00047 
00048 typedef BArchivable *(*instantiation_func) (BMessage *); 
00049 
00050 BArchivable     *instantiate_object(BMessage *from, image_id *id);
00051 BArchivable     *instantiate_object(BMessage *from);
00052 bool                validate_instantiation( BMessage *from, 
00053                                             const char *class_name);
00054 
00055 instantiation_func  find_instantiation_func(const char *class_name,
00056                                                         const char *sig);
00057 instantiation_func  find_instantiation_func(const char *class_name);
00058 instantiation_func  find_instantiation_func(BMessage *archive_data);
00059 
00060 
00061 /*-------------------------------------------------------------*/
00062 /*-------------------------------------------------------------*/
00063 
00064 #endif /* _ARCHIVABLE_H */

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