IPCConfig.hpp

Go to the documentation of this file.
00001 /* Copyright (C) 2003 MySQL AB
00002 
00003    This program is free software; you can redistribute it and/or modify
00004    it under the terms of the GNU General Public License as published by
00005    the Free Software Foundation; either version 2 of the License, or
00006    (at your option) any later version.
00007 
00008    This program is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011    GNU General Public License for more details.
00012 
00013    You should have received a copy of the GNU General Public License
00014    along with this program; if not, write to the Free Software
00015    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
00016 
00017 #ifndef IPCConfig_H
00018 #define IPCConfig_H
00019 
00020 #include <ndb_types.h>
00021 #include <ndb_limits.h>
00022 #include <kernel_types.h>
00023 #include <Properties.hpp>
00024 
00025 /**
00026  * @class IPCConfig
00027  * @brief Config transporters in TransporterRegistry using Properties config
00028  */
00029 class IPCConfig 
00030 {
00031 public:
00032   IPCConfig(Properties * props);
00033   ~IPCConfig();
00034 
00035   /** @return 0 for OK */
00036   int init(); 
00037   
00038   NodeId ownId() const;
00039   
00040   /** @return No of transporters configured */
00041   int configureTransporters(class TransporterRegistry * theTransporterRegistry);
00042 
00043   /**
00044    * Supply a nodeId,
00045    *  and get next higher node id
00046    * @return false if none found, true otherwise
00047    *
00048    * getREPHBFrequency and getNodeType uses the last Id supplied to 
00049    * getNextRemoteNodeId.
00050    */
00051   bool getNextRemoteNodeId(NodeId & nodeId) const;
00052   Uint32 getREPHBFrequency(NodeId id) const;
00053   const char* getNodeType(NodeId id) const;
00054   
00055   NodeId getNoOfRemoteNodes() const {
00056     return theNoOfRemoteNodes;
00057   }
00058 
00059   void print() const { props->print(); }
00060 
00061   static Uint32 configureTransporters(Uint32 nodeId,
00062                                       const class ndb_mgm_configuration &,
00063                                       class TransporterRegistry &);
00064   
00065 private:
00066   NodeId        the_ownId;
00067   Properties *  props;
00068   
00069   bool    addRemoteNodeId(NodeId nodeId);
00070   NodeId  theNoOfRemoteNodes;
00071   NodeId  theRemoteNodeIds[MAX_NODES];
00072 };
00073 
00074 inline 
00075 NodeId 
00076 IPCConfig::ownId() const
00077 {
00078   return the_ownId;
00079 }
00080 
00081 
00082 
00083 #endif // IPCConfig_H

Generated on Thu Feb 24 10:22:20 2005 for MySQL by  doxygen 1.3.9.1