blob: 8d1c696debea72b0986917cacb91d7d13db73ba5 [file] [log] [blame]
Elliott Hughes2faa5f12012-01-30 14:42:07 -08001/*
2 * Copyright (C) 2011 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 */
Brian Carlstrom1f870082011-08-23 16:02:11 -070016
17#ifndef ART_SRC_CLASS_LOADER_H_
18#define ART_SRC_CLASS_LOADER_H_
19
20#include <vector>
21
22#include "dex_file.h"
23#include "object.h"
24
25namespace art {
26
Ian Rogers0cfe1fb2011-08-26 03:29:44 -070027// C++ mirror of java.lang.ClassLoader
Brian Carlstromaded5f72011-10-07 17:15:04 -070028class MANAGED ClassLoader : public Object {
Brian Carlstrom1f870082011-08-23 16:02:11 -070029 private:
30 // Field order required by test "ValidateFieldOrderOfJavaCppUnionClasses".
31 Object* packages_;
32 ClassLoader* parent_;
Jesse Wilson1b5f4972011-10-11 21:41:08 -040033 Object* proxyCache_;
Brian Carlstrom1f870082011-08-23 16:02:11 -070034
Brian Carlstrom693267a2011-09-06 09:25:34 -070035 friend struct ClassLoaderOffsets; // for verifying offset information
Brian Carlstrom1f870082011-08-23 16:02:11 -070036 DISALLOW_IMPLICIT_CONSTRUCTORS(ClassLoader);
37};
38
Ian Rogers0cfe1fb2011-08-26 03:29:44 -070039// C++ mirror of dalvik.system.BaseDexClassLoader
Elliott Hughesb3bd5f02012-03-08 21:05:27 -080040class MANAGED BaseDexClassLoader : public ClassLoader {
Brian Carlstrom1f870082011-08-23 16:02:11 -070041 private:
42 // Field order required by test "ValidateFieldOrderOfJavaCppUnionClasses".
43 String* original_path_;
44 Object* path_list_;
Brian Carlstrom693267a2011-09-06 09:25:34 -070045
46 friend struct BaseDexClassLoaderOffsets; // for verifying offset information
Brian Carlstrom1f870082011-08-23 16:02:11 -070047 DISALLOW_IMPLICIT_CONSTRUCTORS(BaseDexClassLoader);
48};
49
Ian Rogers0cfe1fb2011-08-26 03:29:44 -070050// C++ mirror of dalvik.system.PathClassLoader
Elliott Hughesb3bd5f02012-03-08 21:05:27 -080051class MANAGED PathClassLoader : public BaseDexClassLoader {
Brian Carlstrom1f870082011-08-23 16:02:11 -070052 public:
Brian Carlstrom40381fb2011-10-19 14:13:40 -070053 static PathClassLoader* AllocCompileTime(std::vector<const DexFile*>& dex_files);
Brian Carlstrom1f870082011-08-23 16:02:11 -070054 static void SetClass(Class* dalvik_system_PathClassLoader);
55 static void ResetClass();
56 private:
57 static Class* dalvik_system_PathClassLoader_;
Brian Carlstrom693267a2011-09-06 09:25:34 -070058 friend struct PathClassLoaderOffsets; // for verifying offset information
Brian Carlstrom1f870082011-08-23 16:02:11 -070059 DISALLOW_IMPLICIT_CONSTRUCTORS(PathClassLoader);
60};
61
62} // namespace art
63
Elliott Hughesb3bd5f02012-03-08 21:05:27 -080064#endif // ART_SRC_CLASS_LOADER_H_