Home | History | Annotate | Download | only in Wrap
      1 /*
      2  * Copyright 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 // Define support macros for defining classes, etc.
     18 
     19 #ifndef LLVM_SUPPORT_SUPPORT_MACROS_H__
     20 #define LLVM_SUPPORT_SUPPORT_MACROS_H__
     21 
     22 // Define macro, to use within a class declaration,  to disallow constructor
     23 // copy. Defines copy constructor declaration under the assumption that it
     24 // is never defined.
     25 // NOLINT: Do not add parentheses around 'class_name'.
     26 #define DISALLOW_CLASS_COPY(class_name) \
     27   class_name(class_name& arg)  // NOLINT, Do not implement
     28 
     29 // Define macro, to use within a class declaration,  to disallow assignment.
     30 // Defines assignment operation declaration under the assumption that it
     31 // is never defined.
     32 #define DISALLOW_CLASS_ASSIGN(class_name) \
     33   void operator=(class_name& arg)  // NOLINT, Do not implement
     34 
     35 // Define macro to add copy and assignment declarations to a class file,
     36 // for which no bodies will be defined, effectively disallowing these from
     37 // being defined in the class.
     38 #define DISALLOW_CLASS_COPY_AND_ASSIGN(class_name) \
     39   DISALLOW_CLASS_COPY(class_name); \
     40   DISALLOW_CLASS_ASSIGN(class_name)
     41 
     42 #endif  // LLVM_SUPPORT_SUPPORT_MACROS_H__
     43