1 #ifndef _RSGVARIABLE_HPP
2 #define _RSGVARIABLE_HPP
3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program Random Shader Generator
5 * ----------------------------------------------------
7 * Copyright 2014 The Android Open Source Project
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief Variable class.
24 *//*--------------------------------------------------------------------*/
26 #include "rsgDefs.hpp"
27 #include "rsgVariableType.hpp"
28 #include "rsgToken.hpp"
48 STORAGE_PARAMETER_OUT,
49 STORAGE_PARAMETER_INOUT,
54 Variable (const VariableType& type, Storage storage, const char* name);
57 const VariableType& getType (void) const { return m_type; }
58 Storage getStorage (void) const { return m_storage; }
59 const char* getName (void) const { return m_name.c_str(); }
60 int getLayoutLocation (void) const { return m_layoutLocation; }
61 bool hasLayoutLocation (void) const { return m_layoutLocation >= 0; }
63 void setStorage (Storage storage) { m_storage = storage; }
64 void setLayoutLocation (int location) { m_layoutLocation = location; }
66 bool isWritable (void) const;
68 void tokenizeDeclaration (GeneratorState& state, TokenStream& str) const;
79 #endif // _RSGVARIABLE_HPP