172961230a5890071bcca436eb5630172ce84ec41Andreas Huber/*
272961230a5890071bcca436eb5630172ce84ec41Andreas Huber * Copyright (C) 2010 The Android Open Source Project
372961230a5890071bcca436eb5630172ce84ec41Andreas Huber *
472961230a5890071bcca436eb5630172ce84ec41Andreas Huber * Licensed under the Apache License, Version 2.0 (the "License");
572961230a5890071bcca436eb5630172ce84ec41Andreas Huber * you may not use this file except in compliance with the License.
672961230a5890071bcca436eb5630172ce84ec41Andreas Huber * You may obtain a copy of the License at
772961230a5890071bcca436eb5630172ce84ec41Andreas Huber *
872961230a5890071bcca436eb5630172ce84ec41Andreas Huber *      http://www.apache.org/licenses/LICENSE-2.0
972961230a5890071bcca436eb5630172ce84ec41Andreas Huber *
1072961230a5890071bcca436eb5630172ce84ec41Andreas Huber * Unless required by applicable law or agreed to in writing, software
1172961230a5890071bcca436eb5630172ce84ec41Andreas Huber * distributed under the License is distributed on an "AS IS" BASIS,
1272961230a5890071bcca436eb5630172ce84ec41Andreas Huber * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1372961230a5890071bcca436eb5630172ce84ec41Andreas Huber * See the License for the specific language governing permissions and
1472961230a5890071bcca436eb5630172ce84ec41Andreas Huber * limitations under the License.
1572961230a5890071bcca436eb5630172ce84ec41Andreas Huber */
1672961230a5890071bcca436eb5630172ce84ec41Andreas Huber
1772961230a5890071bcca436eb5630172ce84ec41Andreas Huber#ifndef A_ATOMIZER_H_
1872961230a5890071bcca436eb5630172ce84ec41Andreas Huber
1972961230a5890071bcca436eb5630172ce84ec41Andreas Huber#define A_ATOMIZER_H_
2072961230a5890071bcca436eb5630172ce84ec41Andreas Huber
2172961230a5890071bcca436eb5630172ce84ec41Andreas Huber#include <stdint.h>
2272961230a5890071bcca436eb5630172ce84ec41Andreas Huber
2372961230a5890071bcca436eb5630172ce84ec41Andreas Huber#include <media/stagefright/foundation/ABase.h>
2472961230a5890071bcca436eb5630172ce84ec41Andreas Huber#include <media/stagefright/foundation/AString.h>
2572961230a5890071bcca436eb5630172ce84ec41Andreas Huber#include <utils/List.h>
2672961230a5890071bcca436eb5630172ce84ec41Andreas Huber#include <utils/Vector.h>
2772961230a5890071bcca436eb5630172ce84ec41Andreas Huber#include <utils/threads.h>
2872961230a5890071bcca436eb5630172ce84ec41Andreas Huber
2972961230a5890071bcca436eb5630172ce84ec41Andreas Hubernamespace android {
3072961230a5890071bcca436eb5630172ce84ec41Andreas Huber
3172961230a5890071bcca436eb5630172ce84ec41Andreas Huberstruct AAtomizer {
3272961230a5890071bcca436eb5630172ce84ec41Andreas Huber    static const char *Atomize(const char *name);
3372961230a5890071bcca436eb5630172ce84ec41Andreas Huber
3472961230a5890071bcca436eb5630172ce84ec41Andreas Huberprivate:
3572961230a5890071bcca436eb5630172ce84ec41Andreas Huber    static AAtomizer gAtomizer;
3672961230a5890071bcca436eb5630172ce84ec41Andreas Huber
3772961230a5890071bcca436eb5630172ce84ec41Andreas Huber    Mutex mLock;
3872961230a5890071bcca436eb5630172ce84ec41Andreas Huber    Vector<List<AString> > mAtoms;
3972961230a5890071bcca436eb5630172ce84ec41Andreas Huber
4072961230a5890071bcca436eb5630172ce84ec41Andreas Huber    AAtomizer();
4172961230a5890071bcca436eb5630172ce84ec41Andreas Huber
4272961230a5890071bcca436eb5630172ce84ec41Andreas Huber    const char *atomize(const char *name);
4372961230a5890071bcca436eb5630172ce84ec41Andreas Huber
4472961230a5890071bcca436eb5630172ce84ec41Andreas Huber    static uint32_t Hash(const char *s);
4572961230a5890071bcca436eb5630172ce84ec41Andreas Huber
4672961230a5890071bcca436eb5630172ce84ec41Andreas Huber    DISALLOW_EVIL_CONSTRUCTORS(AAtomizer);
4772961230a5890071bcca436eb5630172ce84ec41Andreas Huber};
4872961230a5890071bcca436eb5630172ce84ec41Andreas Huber
4972961230a5890071bcca436eb5630172ce84ec41Andreas Huber}  // namespace android
5072961230a5890071bcca436eb5630172ce84ec41Andreas Huber
5172961230a5890071bcca436eb5630172ce84ec41Andreas Huber#endif  // A_ATOMIZER_H_
52