2009-07-18 23:11:20 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef FUNCTION_ID_H
|
|
|
|
#define FUNCTION_ID_H
|
|
|
|
|
|
|
|
|
2009-07-24 02:35:30 +00:00
|
|
|
#include <Archivable.h>
|
2009-07-18 23:11:20 +00:00
|
|
|
#include <String.h>
|
|
|
|
|
|
|
|
#include "ObjectID.h"
|
|
|
|
|
|
|
|
|
2009-07-24 02:35:30 +00:00
|
|
|
class FunctionID : public ObjectID, public BArchivable {
|
|
|
|
protected:
|
|
|
|
FunctionID(const BMessage& archive);
|
|
|
|
FunctionID(const BString& path,
|
|
|
|
const BString& functionName);
|
|
|
|
|
2009-07-18 23:11:20 +00:00
|
|
|
public:
|
|
|
|
virtual ~FunctionID();
|
|
|
|
|
2009-07-24 02:35:30 +00:00
|
|
|
virtual status_t Archive(BMessage* archive,
|
|
|
|
bool deep = true) const;
|
|
|
|
|
|
|
|
const BString& FunctionName() const { return fFunctionName; }
|
2009-07-18 23:11:20 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual uint32 ComputeHashValue() const;
|
|
|
|
|
2009-07-24 02:35:30 +00:00
|
|
|
bool IsValid() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
BString fPath;
|
|
|
|
BString fFunctionName;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class SourceFunctionID : public FunctionID {
|
|
|
|
public:
|
|
|
|
SourceFunctionID(const BMessage& archive);
|
|
|
|
SourceFunctionID(const BString& sourceFilePath,
|
|
|
|
const BString& functionName);
|
|
|
|
virtual ~SourceFunctionID();
|
|
|
|
|
|
|
|
static BArchivable* Instantiate(BMessage* archive);
|
|
|
|
|
|
|
|
const BString& SourceFilePath() const { return fPath; }
|
|
|
|
|
|
|
|
virtual bool operator==(const ObjectID& other) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class ImageFunctionID : public FunctionID {
|
|
|
|
public:
|
|
|
|
ImageFunctionID(const BMessage& archive);
|
|
|
|
ImageFunctionID(const BString& imageName,
|
|
|
|
const BString& functionName);
|
|
|
|
virtual ~ImageFunctionID();
|
|
|
|
|
|
|
|
static BArchivable* Instantiate(BMessage* archive);
|
|
|
|
|
|
|
|
const BString& ImageName() const { return fPath; }
|
|
|
|
|
|
|
|
virtual bool operator==(const ObjectID& other) const;
|
2009-07-18 23:11:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // FUNCTION_ID_H
|