blob: 23ae85c416223086cf01fa37234cfe646f397ce7 [file] [log] [blame]
Jason Sams221a4b12012-02-22 15:22:41 -08001/*
Jason Sams69cccdf2012-04-02 19:11:49 -07002 * Copyright (C) 2012 The Android Open Source Project
Jason Sams221a4b12012-02-22 15:22:41 -08003 *
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
Jason Sams69cccdf2012-04-02 19:11:49 -070021#include "utils/RefBase.h"
Jason Sams221a4b12012-02-22 15:22:41 -080022#include <pthread.h>
23#include <rs.h>
24
25#include "RenderScript.h"
26
Jason Sams69cccdf2012-04-02 19:11:49 -070027namespace android {
28namespace renderscriptCpp {
29
30
31class BaseObj : public android::LightRefBase<BaseObj> {
Jason Sams221a4b12012-02-22 15:22:41 -080032protected:
33 friend class Element;
34 friend class Type;
Jason Samsb2e3dc52012-02-23 17:14:39 -080035 friend class Allocation;
36 friend class Script;
37 friend class ScriptC;
Jason Sams221a4b12012-02-22 15:22:41 -080038
39 void *mID;
40 RenderScript *mRS;
41 android::String8 mName;
42
43 void * getID() const;
44
45 BaseObj(void *id, RenderScript *rs);
46 void checkValid();
47
Jason Sams69cccdf2012-04-02 19:11:49 -070048 static void * getObjID(sp<const BaseObj> o);
Jason Samsb2e3dc52012-02-23 17:14:39 -080049
Jason Sams221a4b12012-02-22 15:22:41 -080050public:
51
52 virtual ~BaseObj();
53 virtual void updateFromNative();
54 virtual bool equals(const BaseObj *obj);
55};
56
Jason Sams69cccdf2012-04-02 19:11:49 -070057}
58}
Jason Sams221a4b12012-02-22 15:22:41 -080059#endif