• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

P_RecUtils.h

Go to the documentation of this file.
00001 /** @file
00002 
00003   Private record util declarations
00004 
00005   @section license License
00006 
00007   Licensed to the Apache Software Foundation (ASF) under one
00008   or more contributor license agreements.  See the NOTICE file
00009   distributed with this work for additional information
00010   regarding copyright ownership.  The ASF licenses this file
00011   to you under the Apache License, Version 2.0 (the
00012   "License"); you may not use this file except in compliance
00013   with the License.  You may obtain a copy of the License at
00014 
00015       http://www.apache.org/licenses/LICENSE-2.0
00016 
00017   Unless required by applicable law or agreed to in writing, software
00018   distributed under the License is distributed on an "AS IS" BASIS,
00019   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00020   See the License for the specific language governing permissions and
00021   limitations under the License.
00022  */
00023 
00024 #ifndef _P_REC_UTILS_H_
00025 #define _P_REC_UTILS_H_
00026 
00027 #include "Diags.h"
00028 #include "ink_atomic.h"
00029 
00030 #include "P_RecDefs.h"
00031 
00032 //-------------------------------------------------------------------------
00033 // Macros
00034 //-------------------------------------------------------------------------
00035 
00036 #define REC_TYPE_IS_STAT(rec_type) \
00037   (((rec_type) == RECT_PROCESS) || \
00038    ((rec_type) == RECT_PLUGIN) || \
00039    ((rec_type) == RECT_NODE) || \
00040    ((rec_type) == RECT_CLUSTER))
00041 
00042 #define REC_TYPE_IS_CONFIG(rec_type) \
00043   (((rec_type) == RECT_CONFIG) || \
00044    ((rec_type) == RECT_LOCAL))
00045 
00046 
00047 //-------------------------------------------------------------------------
00048 // RecRecord Utils
00049 //-------------------------------------------------------------------------
00050 void RecRecordInit(RecRecord *r);
00051 void RecRecordFree(RecRecord *r);
00052 RecRecord *RecAlloc(RecT rec_type, const char *name, RecDataT data_type);
00053 
00054 
00055 //-------------------------------------------------------------------------
00056 // RecData Utils
00057 //-------------------------------------------------------------------------
00058 
00059 void RecDataClear(RecDataT type, RecData * data);
00060 void RecDataSetMax(RecDataT type, RecData * data);
00061 void RecDataSetMin(RecDataT type, RecData * data);
00062 bool RecDataSet(RecDataT data_type, RecData * data_dst, RecData * data_src);
00063 bool RecDataSetFromInk64(RecDataT data_type, RecData * data_dst, int64_t data_int64);
00064 bool RecDataSetFromFloat(RecDataT data_type, RecData * data_dst, float data_float);
00065 bool RecDataSetFromString(RecDataT data_type, RecData * data_dst, const char *data_string);
00066 int RecDataCmp(RecDataT type, RecData left, RecData right);
00067 RecData RecDataAdd(RecDataT type, RecData left, RecData right);
00068 RecData RecDataSub(RecDataT type, RecData left, RecData right);
00069 RecData RecDataMul(RecDataT type, RecData left, RecData right);
00070 RecData RecDataDiv(RecDataT type, RecData left, RecData right);
00071 
00072 
00073 //-------------------------------------------------------------------------
00074 // Logging
00075 //-------------------------------------------------------------------------
00076 
00077 void RecLog(DiagsLevel dl, const char *format_string, ...);
00078 void RecDebug(DiagsLevel dl, const char *format_string, ...);
00079 void RecDebugOff();
00080 
00081 #endif

Generated by  doxygen 1.7.1