src/share/vm/services/writeableFlags.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 8059557_open Sdiff src/share/vm/services

src/share/vm/services/writeableFlags.hpp

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_SERVICES_WRITEABLEFLAG_HPP
  26 #define SHARE_VM_SERVICES_WRITEABLEFLAG_HPP
  27 
  28 class WriteableFlags : AllStatic {
  29 public:
  30   enum error {
  31     // no error
  32     SUCCESS,
  33     // flag name is missing
  34     MISSING_NAME,
  35     // flag value is missing
  36     MISSING_VALUE,
  37     // error parsing the textual form of the value
  38     WRONG_FORMAT,
  39     // flag is not writeable
  40     NON_WRITABLE,
  41     // flag value is outside of its bounds
  42     OUT_OF_BOUNDS,
  43     // there is no flag with the given name
  44     INVALID_FLAG,
  45     // other, unspecified error related to setting the flag
  46     ERR_OTHER
  47   } err;
  48 
  49 private:
  50   // a writeable flag setter accepting either 'jvalue' or 'char *' values
  51   static int set_flag(const char* name, const void* value, int(*setter)(Flag*, const void*, Flag::Flags, FormatBuffer<80>&), Flag::Flags origin, FormatBuffer<80>& err_msg);
  52   // a writeable flag setter accepting 'char *' values
  53   static int set_flag_from_char(Flag* f, const void* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  54   // a writeable flag setter accepting 'jvalue' values
  55   static int set_flag_from_jvalue(Flag* f, const void* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  56 
  57   // set a boolean global flag
  58   static int set_bool_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  59   // set a intx global flag
  60   static int set_intx_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  61   // set a uintx global flag
  62   static int set_uintx_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  63   // set a uint64_t global flag
  64   static int set_uint64_t_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  65   // set a size_t global flag using value from AttachOperation
  66   static int set_size_t_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  67   // set a boolean global flag
  68   static int set_bool_flag(const char* name, bool value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  69   // set a intx global flag
  70   static int set_intx_flag(const char* name, intx value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  71   // set a uintx global flag
  72   static int set_uintx_flag(const char* name, uintx value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  73   // set a uint64_t global flag
  74   static int set_uint64_t_flag(const char* name, uint64_t value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  75   // set a size_t global flag using value from AttachOperation
  76   static int set_size_t_flag(const char* name, size_t value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  77   // set a string global flag
  78   static int set_ccstr_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  79 
  80 public:
  81   /* sets a writeable flag to the provided value
  82    *
  83    * - return status is one of the WriteableFlags::err enum values
  84    * - an eventual error message will be generated to the provided err_msg buffer
  85    */
  86   static int set_flag(const char* flag_name, const char* flag_value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  87 
  88   /* sets a writeable flag to the provided value
  89    *
  90    * - return status is one of the WriteableFlags::err enum values
  91    * - an eventual error message will be generated to the provided err_msg buffer
  92    */
  93   static int set_flag(const char* flag_name, jvalue flag_value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  94 };
  95 
  96 #endif /* SHARE_VM_SERVICES_WRITEABLEFLAG_HPP */
  97 


   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_SERVICES_WRITEABLEFLAG_HPP
  26 #define SHARE_VM_SERVICES_WRITEABLEFLAG_HPP
  27 
  28 class WriteableFlags : AllStatic {




















  29 private:
  30   // a writeable flag setter accepting either 'jvalue' or 'char *' values
  31   static Flag::Error set_flag(const char* name, const void* value, Flag::Error(*setter)(Flag*, const void*, Flag::Flags, FormatBuffer<80>&), Flag::Flags origin, FormatBuffer<80>& err_msg);
  32   // a writeable flag setter accepting 'char *' values
  33   static Flag::Error set_flag_from_char(Flag* f, const void* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  34   // a writeable flag setter accepting 'jvalue' values
  35   static Flag::Error set_flag_from_jvalue(Flag* f, const void* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  36 
  37   // set a boolean global flag
  38   static Flag::Error set_bool_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  39   // set a intx global flag
  40   static Flag::Error set_intx_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  41   // set a uintx global flag
  42   static Flag::Error set_uintx_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  43   // set a uint64_t global flag
  44   static Flag::Error set_uint64_t_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  45   // set a size_t global flag using value from AttachOperation
  46   static Flag::Error set_size_t_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  47   // set a boolean global flag
  48   static Flag::Error set_bool_flag(const char* name, bool value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  49   // set a intx global flag
  50   static Flag::Error set_intx_flag(const char* name, intx value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  51   // set a uintx global flag
  52   static Flag::Error set_uintx_flag(const char* name, uintx value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  53   // set a uint64_t global flag
  54   static Flag::Error set_uint64_t_flag(const char* name, uint64_t value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  55   // set a size_t global flag using value from AttachOperation
  56   static Flag::Error set_size_t_flag(const char* name, size_t value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  57   // set a string global flag
  58   static Flag::Error set_ccstr_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  59 
  60 public:
  61   /* sets a writeable flag to the provided value
  62    *
  63    * - return status is one of the WriteableFlags::err enum values
  64    * - an eventual error message will be generated to the provided err_msg buffer
  65    */
  66   static Flag::Error set_flag(const char* flag_name, const char* flag_value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  67 
  68   /* sets a writeable flag to the provided value
  69    *
  70    * - return status is one of the WriteableFlags::err enum values
  71    * - an eventual error message will be generated to the provided err_msg buffer
  72    */
  73   static Flag::Error set_flag(const char* flag_name, jvalue flag_value, Flag::Flags origin, FormatBuffer<80>& err_msg);
  74 };
  75 
  76 #endif /* SHARE_VM_SERVICES_WRITEABLEFLAG_HPP */
  77 
src/share/vm/services/writeableFlags.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File