/usr/share/cruisecontrol-bin-2.6.1/projects/qpid-trunk/cpp/src/qpid/management/Manageable.h

00001 #ifndef _Manageable_
00002 #define _Manageable_
00003 
00004 //
00005 // Licensed to the Apache Software Foundation (ASF) under one
00006 // or more contributor license agreements.  See the NOTICE file
00007 // distributed with this work for additional information
00008 // regarding copyright ownership.  The ASF licenses this file
00009 // to you under the Apache License, Version 2.0 (the
00010 // "License"); you may not use this file except in compliance
00011 // with the License.  You may obtain a copy of the License at
00012 // 
00013 //   http://www.apache.org/licenses/LICENSE-2.0
00014 // 
00015 // Unless required by applicable law or agreed to in writing,
00016 // software distributed under the License is distributed on an
00017 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00018 // KIND, either express or implied.  See the License for the
00019 // specific language governing permissions and limitations
00020 // under the License.
00021 //
00022 
00023 #include "ManagementObject.h"
00024 #include "Args.h"
00025 #include <string>
00026 #include <boost/shared_ptr.hpp>
00027 
00028 namespace qpid { 
00029 namespace management {
00030 
00031 class Manageable
00032 {
00033   public:
00034 
00035     virtual ~Manageable (void) = 0;
00036 
00037     //  status_t is a type used to pass completion status from the method handler.
00038     //
00039     typedef uint32_t status_t;
00040     static std::string StatusText (status_t status);
00041 
00042     static const status_t STATUS_OK                = 0;
00043     static const status_t STATUS_UNKNOWN_OBJECT    = 1;
00044     static const status_t STATUS_UNKNOWN_METHOD    = 2;
00045     static const status_t STATUS_NOT_IMPLEMENTED   = 3;
00046     static const status_t STATUS_INVALID_PARAMETER = 4;
00047 
00048     //  Every "Manageable" object must hold a reference to exactly one
00049     //  management object.  This object is always of a class derived from
00050     //  the pure-virtual "ManagementObject".
00051     //
00052     //  This accessor function returns a shared_ptr to the management object.
00053     //
00054     virtual ManagementObject::shared_ptr GetManagementObject (void) const = 0;
00055 
00056     //  Every "Manageable" object must implement ManagementMethod.  This
00057     //  function is called when a remote management client invokes a method
00058     //  on this object.  The input and output arguments are specific to the
00059     //  method being called and must be down-cast to the appropriate sub class
00060     //  before use.
00061     virtual status_t ManagementMethod (uint32_t methodId, Args& args) = 0;
00062 };
00063 
00064 inline Manageable::~Manageable (void) {}
00065 
00066 }}
00067 
00068 #endif  

Generated on Thu Apr 10 11:08:18 2008 for Qpid by  doxygen 1.4.7