blob: 79761b1aa902333b2e3109dfd15af0dce69bf295 [file] [log] [blame]
Jason Samsf70b0fc2012-02-22 15:22:41 -08001/*
2 * Copyright (C) 2008-2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef __ANDROID_BASE_OBJ_H__
18#define __ANDROID_BASE_OBJ_H__
19
20
21#include <pthread.h>
22#include <rs.h>
23
24#include "RenderScript.h"
25
26class BaseObj {
27protected:
28 friend class Element;
29 friend class Type;
Jason Sams170dc842012-02-23 17:14:39 -080030 friend class Allocation;
31 friend class Script;
32 friend class ScriptC;
Jason Samsf70b0fc2012-02-22 15:22:41 -080033
34 void *mID;
35 RenderScript *mRS;
36 android::String8 mName;
37
38 void * getID() const;
39
40 BaseObj(void *id, RenderScript *rs);
41 void checkValid();
42
Jason Sams170dc842012-02-23 17:14:39 -080043 static void * getObjID(const BaseObj *o);
44
Jason Samsf70b0fc2012-02-22 15:22:41 -080045public:
46
47 virtual ~BaseObj();
48 virtual void updateFromNative();
49 virtual bool equals(const BaseObj *obj);
50};
51
52#endif