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 #define DISALLOW_CLASS_COPY(class_name) \
     26   class_name(class_name& arg)  // Do not implement
     27 
     28 // Define macro, to use within a class declaration,  to disallow assignment.
     29 // Defines assignment operation declaration under the assumption that it
     30 // is never defined.
     31 #define DISALLOW_CLASS_ASSIGN(class_name) \
     32   void operator=(class_name& arg)  // Do not implement
     33 
     34 // Define macro to add copy and assignment declarations to a class file,
     35 // for which no bodies will be defined, effectively disallowing these from
     36 // being defined in the class.
     37 #define DISALLOW_CLASS_COPY_AND_ASSIGN(class_name) \
     38   DISALLOW_CLASS_COPY(class_name); \
     39   DISALLOW_CLASS_ASSIGN(class_name)
     40 
     41 #endif  // LLVM_SUPPORT_SUPPORT_MACROS_H__
     42