Home | History | Annotate | Download | only in tests
      1 /*
      2  * Copyright (C) 2017 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 
     18 #ifndef ESE_OPERATIONS_WRAPPER_H_
     19 #define ESE_OPERATIONS_WRAPPER_H_ 1
     20 
     21 #include <ese/ese.h>
     22 #include "ese_operations_interface.h"
     23 
     24 // Wraps a supplied interface object with static calls.
     25 // This acts as a singleton. If mulitple instances are needed, the
     26 // multion pattern would be more appropriate.
     27 class EseOperationsWrapperData {
     28  public:
     29   static EseOperationsInterface *ops_interface;
     30   static const struct EseOperations ops;
     31   static const struct EseOperations *wrapper_ops;
     32 };
     33 
     34 class EseOperationsWrapper {
     35  public:
     36   // Naming convention to be compatible with ese_init();
     37   EseOperationsWrapper() = default;
     38   virtual ~EseOperationsWrapper() = default;
     39   static void InitializeEse(struct EseInterface *ese, EseOperationsInterface *ops_interface);
     40 };
     41 
     42 #endif  // ESE_OPERATIONS_WRAPPER_H_
     43