Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A2213200D21 for ; Mon, 16 Oct 2017 16:19:46 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A071F1609EC; Mon, 16 Oct 2017 14:19:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E981F160BFE for ; Mon, 16 Oct 2017 16:19:41 +0200 (CEST) Received: (qmail 90423 invoked by uid 500); 16 Oct 2017 14:19:41 -0000 Mailing-List: contact commits-help@arrow.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@arrow.apache.org Delivered-To: mailing list commits@arrow.apache.org Received: (qmail 90116 invoked by uid 99); 16 Oct 2017 14:19:40 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Oct 2017 14:19:40 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 90AADDFCA1; Mon, 16 Oct 2017 14:19:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: wesm@apache.org To: commits@arrow.apache.org Date: Mon, 16 Oct 2017 14:20:03 -0000 Message-Id: <1244db05bbe84ae6a10539ce3f201eaa@git.apache.org> In-Reply-To: <7c9f1061d5dc49e4b51356bc4d9a83d8@git.apache.org> References: <7c9f1061d5dc49e4b51356bc4d9a83d8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [25/51] [partial] arrow-site git commit: Add Ray serialization blog post, update API docs archived-at: Mon, 16 Oct 2017 14:19:46 -0000 http://git-wip-us.apache.org/repos/asf/arrow-site/blob/7a2e5ece/docs/cpp/logging_8h_source.html ---------------------------------------------------------------------- diff --git a/docs/cpp/logging_8h_source.html b/docs/cpp/logging_8h_source.html index fe83b6c..0c42dec 100644 --- a/docs/cpp/logging_8h_source.html +++ b/docs/cpp/logging_8h_source.html @@ -5,7 +5,7 @@ -Apache Arrow (C++): /home/wesm/code/arrow/cpp/src/arrow/util/logging.h Source File +Apache Arrow (C++): /apache-arrow/arrow/cpp/src/arrow/util/logging.h Source File @@ -67,9 +67,10 @@ $(function() {
logging.h
-Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing,
12 // software distributed u nder the License is distributed on an
13 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, either express or implied. See the License for the
15 // specific language governing permissions and limitations
16 // under the License.
17 
18 #ifndef ARROW_UTIL_LOGGING_H
19 #define ARROW_UTIL_LOGGING_H
20 
21 #include <cstdlib>
22 #include <iostream>
23 
24 #include "arrow/util/macros.h"
25 
26 namespace arrow {
27 
28 // Stubbed versions of macros defined in glog/logging.h, intended for
29 // environments where glog headers aren't available.
30 //
31 // Add more as needed.
32 
33 // Log levels. LOG ignores them, so their values are abitrary.
34 
35 #define ARROW_DEBUG (-1)
36 #define ARROW_INFO 0
37 #define ARROW_WARNING 1
38 #define ARROW_ERROR 2
39 #define ARROW_FATAL 3
40 
41 #define ARROW_LOG_INTERNAL(level) ::arrow::internal::CerrLog(level)
42 #define ARROW_LOG(level) ARROW_LOG_INTERNAL(ARROW_##level)
43 #define ARROW_IGNORE_EXPR(expr) ((void)(expr));
44 
45 #define ARROW_CHECK(condition) \
46  (condition) ? 0 \
47  : ::arrow::internal::FatalLog(ARROW_FATAL) \
48  << __FILE__ << __LINE__ << " Check failed: " #condition " "
49 
50 #ifdef NDEBUG
51 #define ARROW_DFATAL ARROW_WARNING
52 
53 #define DCHECK(condition) \
54  ARROW_IGNORE_EXPR(condition) \
55  while (false) ::arrow::internal::NullLog()
56 #define DCHECK_EQ(val1, val2) \
57  ARROW_IGNORE_EXPR(val1) \
58  while (false) ::arrow::internal::NullLog()
59 #define DCHECK_NE(val1, val2) \
60  ARROW_IGNORE_EXPR(val1) \
61  while (false) ::arrow::internal::NullLog()
62 #define DCHECK_LE(val1, val2) \
63  ARROW_IGNORE _EXPR(val1) \
64  while (false) ::arrow::internal::NullLog()
65 #define DCHECK_LT(val1, val2) \
66  ARROW_IGNORE_EXPR(val1) \
67  while (false) ::arrow::internal::NullLog()
68 #define DCHECK_GE(val1, val2) \
69  ARROW_IGNORE_EXPR(val1) \
70  while (false) ::arrow::internal::NullLog()
71 #define DCHECK_GT(val1, val2) \
72  ARROW_IGNORE_EXPR(val1) \
73  while (false) ::arrow::internal::NullLog()
74 
75 #else
76 #define ARROW_DFATAL ARROW_FATAL< /span>
77 
78 #define DCHECK(condition) ARROW_CHECK(condition)
79 #define DCHECK_EQ(val1, val2) ARROW_CHECK((val1) == (val2))
80 #define DCHECK_NE(val1, val2) ARROW_CHECK((val1) != (val2))
81& #160;#define DCHECK_LE(val1, val2) ARROW_CHECK((val1) <= (val2))
82 #define DCHECK_LT(val1, val2) ARROW_CHECK((val1) < (val2))
83 #define DCHECK_GE(val1, val2) ARROW_CHECK((val1) >= (val2))
84 #define DCHECK_GT(val1, val2) ARROW_CHECK((val1) > (val2))
85 
87 
88 namespace internal {
89 
90 class NullLog {
91  public:
92  template <class T>
93  NullLog& operator<<(const T& t) {
< a name="l00094"> 94  return *this;
95  }
96 };
97 
98 class CerrLog {
99  public:
100  CerrLog(int severity) // NOLINT(runtime/explicit)
101  : severity_(severity), has_logged_(false) {}
102 
103  virtual ~CerrLog() {
104  if (has_logged_) {
105  std::cerr << std::endl;
106  }
107  if (severity_ == ARROW_FATAL) {
108  std::exit(1);
109  }
110  }
111 
112  template <class T>
113  CerrLog& operator<<(const T& t) {
114  if (severity_ != ARROW_DEBUG) {
115  has_logged_ = true;
116  std::cerr << t;
117  }
118  return *this;
119  }
120 
121  protected:
122  const int severity_;
123  bool has_logged_;
124 };
125&# 160;
126 // Clang-tidy isn't smart enough to determine that DCHECK using CerrLog doesn't
127 // return so we create a new class to give it a hint.
128 class FatalLog : public CerrLog {
129  public:
130  explicit FatalLog(int /* severity */) // NOLINT
131  : CerrLog(ARROW_FATAL) {} // NOLINT
132 
133  ARROW_NORETURN ~FatalLog() {
134  if (has_logged_) {
135  std::cerr << std::endl;
136  }
137  std::exit(1);
138  }
< a name="l00139"> 139 };
140 
141 } // namespace internal
142 
143 } // namespace arrow
144 
145 #endif // ARROW_UTIL_LOGGING_H
#define ARROW_NORETURN
Definition: macros.h:47
+Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing,
12 // software distributed u nder the License is distributed on an
13 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, either express or implied. See the License for the
15 // specific language governing permissions and limitations
16 // under the License.
17 
18 #ifndef ARROW_UTIL_LOGGING_H
19 #define ARROW_UTIL_LOGGING_H
20 
21 #include <cstdlib>
22 #include <iostream>
23 
24 #include "arrow/util/macros.h"
25 
26 namespace arrow {
27 
28 // Stubbed versions of macros defined in glog/logging.h, intended for
29 // environments where glog headers aren't available.
30 //
31 // Add more as needed.
32 
33 // Log levels. LOG ignores them, so their values are abitrary.
34 
35 #define ARROW_DEBUG (-1)
36 #define ARROW_INFO 0
37 #define ARROW_WARNING 1
38 #define ARROW_ERROR 2
39 #define ARROW_FATAL 3
40 
41 #define ARROW_LOG_INTERNAL(level) ::arrow::internal::CerrLog(level)
42 #define ARROW_LOG(level) ARROW_LOG_INTERNAL(ARROW_##level)
43 #define ARROW_IGNORE_EXPR(expr) ((void)(expr));
44 
45 #define ARROW_CHECK(condition) \
46  (condition) ? 0 \
47  : ::arrow::internal::FatalLog(ARROW_FATAL) \
48  << __FILE__ << ":" << __LINE__ << " Check failed: " #condition " "
49 
50 #ifdef NDEBUG
51 #define ARROW_DFATAL ARROW_WARNING
52 
53 #define DCHECK(condition) \
54  ARROW_IGNORE_EXPR(condition) \
55  while (false) ::arrow::internal::NullLog()
56 #define DCHECK_EQ(val1, val2) \
< a name="l00057"> 57  ARROW_IGNORE_EXPR(val1) \
58  while (false) ::arrow::internal::NullLog()
59 #define DCHECK_NE(val1, val2) \
60  ARROW_IGNORE_EXPR(val1) \
61  while (false) ::arrow::internal::NullLog()
62 #define DCHECK_LE(val1, val2) \
63  ARROW_IGNORE_EXPR(val1) \
64  while (false) ::arrow::internal::NullLog()
65 #define DCHECK_LT(val1, val2) \
66  ARROW_IGNORE_EXPR(val1) \
67  while (false) ::arrow::internal::NullLog()
68 #define DCHECK_GE(val1, val2) \
69  ARROW_IGNORE_EXPR(val1) \
70  while (false) ::arrow::internal::NullLog()
71 #define DCHECK_GT(val1, val2) \
72  ARROW_IGNORE_EXPR(val1) \
73  while (false) ::arrow::internal::NullLog()
74 
75 #else
76 #define AR ROW_DFATAL ARROW_FATAL
77 
78 #define DCHECK(condition) ARROW_CHECK(condition)
79 #define DCHECK_EQ(val1, val2) ARROW_CHECK((val1) == (val2))
80 #define DCHECK_NE(val1, val2) ARROW_CHECK((val1) != (val2))
81 #define DCHECK_LE(val1, val2) ARROW_CHECK((val1) <= (val2))
82 #define DCHECK_LT(val1, val2) ARROW_CHECK((val1) < (val2))
83 #define DCHECK_GE(val1, val2) ARROW_CHECK((val1) >= (val2))
84 #define DCHECK_GT(val1, val2) ARROW_CHECK((val1) > (val2))
85 
86 #endif // NDEBUG
87 
88 namespace internal {
89 
90 class NullLog {
91  public:
92  template <class T>
93  NullLog& operator<<(const T& ARROW_ARG_UNUSED(t)) {
94  return *this;
95  }
96 };
97 
98 class CerrLog {
99  public:
100  CerrLog(int severity) // NOLINT(runtime/explicit)
101  : severity_(severity), has_logged_(false) {}
102 
103  virtual ~CerrLog() {
104  if (has_logged_) {
105  std::cerr << std::endl;
106  }
107  if (severity_ == ARROW_FATAL) {
108  std::exit(1);
109  }
110  }
111 
112  template <class T>
113  CerrLog& operator<<(const T& t) {
114  if (severity_ != ARROW_DEBUG) {
115  has_logged_ = true;
116  std::cerr << t;
117  }
118  return *this;
119  }
120 
121  protected:
122  const int severity_;
123  bool has_logged_;
124 };
125 
126 // Clang-tidy isn't smart enough to determine that DCHECK using CerrLog doesn't
127 // return so we create a new class to give it a hint.
128 class FatalLog : public CerrLog {
129  public:
130  explicit FatalLog(int /* severity */) // NOLINT
131  : CerrLog(ARROW_FATAL) {} // NOLINT
132 
133  ARROW_NORETURN ~FatalLog() {
134  if (has_logged_) {
135  std::cerr << std::endl;
136  }
137  std::exi t(1);
138  }
139 };
140 
141 } // namespace internal
142 
143 } // namespace arrow
144 
145 #endif // ARROW_UTIL_LOGGING_H
#define ARROW_NORETURN
Definition: macros.h:47
#define ARROW_FATAL
Definition: logging.h:39
#define ARROW_DEBUG
Definition: logging.h:35
+
#define ARROW_ARG_UNUSED(x)
Definition: macros.h:29
Top-level namespace for Apache Arrow C++ API.
Definition: allocator.h:28
http://git-wip-us.apache.org/repos/asf/arrow-site/blob/7a2e5ece/docs/cpp/macros_8h.html ---------------------------------------------------------------------- diff --git a/docs/cpp/macros_8h.html b/docs/cpp/macros_8h.html index acc9949..4c1033e 100644 --- a/docs/cpp/macros_8h.html +++ b/docs/cpp/macros_8h.html @@ -5,7 +5,7 @@ -Apache Arrow (C++): /home/wesm/code/arrow/cpp/src/arrow/util/macros.h File Reference +Apache Arrow (C++): /apache-arrow/arrow/cpp/src/arrow/util/macros.h File Reference @@ -78,6 +78,8 @@ Macros   #define ARROW_UNUSED(x)   (void)x   +#define ARROW_ARG_UNUSED(x) +  #define ARROW_NORETURN   #define ARROW_PREDICT_FALSE(x)   x @@ -90,6 +92,24 @@ Macros  

Macro Definition Documentation

+ +

◆ ARROW_ARG_UNUSED

+ +
+
+ + + + + + + + +
#define ARROW_ARG_UNUSED( x)
+
+ +
+

◆ ARROW_DISALLOW_COPY_AND_ASSIGN

http://git-wip-us.apache.org/repos/asf/arrow-site/blob/7a2e5ece/docs/cpp/macros_8h_source.html ---------------------------------------------------------------------- diff --git a/docs/cpp/macros_8h_source.html b/docs/cpp/macros_8h_source.html index 1b0f257..ef12ce7 100644 --- a/docs/cpp/macros_8h_source.html +++ b/docs/cpp/macros_8h_source.html @@ -5,7 +5,7 @@ -Apache Arrow (C++): /home/wesm/code/arrow/cpp/src/arrow/util/macros.h Source File +Apache Arrow (C++): /apache-arrow/arrow/cpp/src/arrow/util/macros.h Source File @@ -67,7 +67,7 @@ $(function() {
macros.h
-Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing,
12 // software distributed un der the License is distributed on an
13 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, either express or implied. See the License for the
15 // specific language governing permissions and limitations
16 // under the License.
17 
18 #ifndef ARROW_UTIL_MACROS_H
19 #define ARROW_UTIL_MACROS_H
20 
21 // From Google gutil
22 #ifndef ARROW_DISALLOW_COPY_AND_ASSIGN
23 #define ARROW_DISALLOW_COPY_AND_ASSIGN(TypeName) \
24  TypeName(const TypeName&) = delete; \
25  void operator=(co nst TypeName&) = delete
26 #endif
27 
28 #define ARROW_UNUSED(x) (void)x
29 
30 //
31 // GCC can be told that a certain branch is not likely to be taken (for
32 // instance, a CHECK failure), and use th at information in static analysis.
33 // Giving it this information can help it optimize for the common case in
34 // the absence of better information (ie. -fprofile-arcs).
35 //
36 #if defined(__GNUC__)
37 #define ARROW_PREDICT_FALSE(x) (__builtin_expect(x, 0))
38 #define ARROW_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
39 #define ARROW_NORETURN __attribute__((noreturn))
40 #define ARROW_PREFETCH(addr) __builtin_prefetch(addr)
41 #elif defined(_MSC_VER)
42 #define ARROW_NORETURN __declspec(noreturn)
43 #define ARROW_PREDICT_FALSE(x) x
44 #define ARROW_PREDICT_TRUE(x) x
45 #define ARROW_PREFETCH(addr)
46 #else
47 #define ARROW_NORETURN
48 #define ARROW_PREDICT_FALSE(x) x
49 #define ARROW_PREDICT_TRUE(x) x
50 #define ARROW_PREFETCH(addr)
51 #endif
52 
53 #if (defined(__GNUC__) || defined(__APPLE__))
54 #define ARROW_MUST_USE_RESULT __attribute__((warn_unused_result))
55 #elif defined(_MSC_VER)
56 #define ARROW_MUST_USE_RESULT
57 #else
58 #define ARROW_MUST_USE_RESULT
59 #endif
60 
61 // macros to disable padding
62 // these macros are portable across different compilers and platforms
63 //[https://github.com/google/flatbuffers/blob/master/include/fl atbuffers/flatbuffers.h#L1355]
64 #if !defined(MANUALLY_ALIGNED_STRUCT)
65 #if defined(_MSC_VER)
66 #define MANUALLY_ALIGNED_STRUCT(alignment) \
67  __pragma(pack(1)); \
68  struct __declspec(align(alignment))
69 #define STRUCT_END(name, size) \
70  __pragma(pack()); \
71  static_assert(sizeof(name) == size, "compiler breaks packing rules")
72 #elif defined(__GNUC__) || defined(__clang__)
73 #define MANUALLY_ALIGNED_STRUCT(alignment) \
74  _Pragma("pack(1)") struct __attribute__((aligned(alignment)))
75 #define STRUCT_END(name, size) \
76  _Pragma("pack()") static_assert(sizeof(name) == size, "compiler breaks packing rules")
77 #else
78 #error Unknown compiler, please define structure alignment macros
79 #endif
80 #endif // !defined(MANUALLY_ALIGNED_STRUCT)
81 
82 #end if // ARROW_UTIL_MACROS_H
+Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing,
12 // software distributed un der the License is distributed on an
13 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, either express or implied. See the License for the
15 // specific language governing permissions and limitations
16 // under the License.
17 
18 #ifndef ARROW_UTIL_MACROS_H
19 #define ARROW_UTIL_MACROS_H
20 
21 // From Google gutil
22 #ifndef ARROW_DISALLOW_COPY_AND_ASSIGN
23 #define ARROW_DISALLOW_COPY_AND_ASSIGN(TypeName) \
24  TypeName(const TypeName&) = delete; \
25  void operator=(co nst TypeName&) = delete
26 #endif
27 
28 #define ARROW_UNUSED(x) (void)x
29 #define ARROW_ARG_UNUSED(x)
30 //
31 // GCC can be told that a certain branch is not likely to be taken (for
32 // instance, a CHECK failure), and use that information in static analysis.
33 // Giving it this information can help it optimize for the common case in
34 // the absence of better information (ie. -fprofile-arcs).
35 //
36 #if defined(__GNUC__)
37 #define ARROW_PREDICT_FALSE(x) (__builtin_expect(x, 0))
38 #define ARROW_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
39 #define ARROW_NORETURN __attribute__((noreturn))
40 #define ARROW_PREFETCH(addr) __builtin_prefetch(addr)
41 #elif defined(_MSC_VER)
42 #define ARROW_NORETURN __declspec(noreturn)
43 #define ARROW_PREDICT_FALSE(x) x
44 #define ARROW_PREDICT_TRUE(x) x
45 #define ARROW_PREFETCH(addr)
46 #else
47 #define ARROW_NORETURN
48 #define ARROW_PREDICT_FALSE(x) x
49 #define ARROW_PRE DICT_TRUE(x) x
50 #define ARROW_PREFETCH(addr)
51 #endif
52 
53 #if (defined(__GNUC__) || defined(__APPLE__))
54 #define ARROW_MUST_USE_RESULT __attribute__((warn_unused_result))
55 #elif defined(_MSC_VER)
56 #define ARROW_MUST_USE_RESULT
57 #else
58 #define ARROW_MUST_USE_RESULT
59 #endif
60 
61 // macros to disable padding
62 // these macros are portable across different compilers and platforms
63 //[https://github.com/google/flatbuffers/blob/master/include/flatbuffers/flatbuffers.h#L1355]
64 #if !defined(MANUALLY_ALIGNED_STRUCT)
65 #if defined(_MSC_VER)
66 #define MANUALLY_ALIGNED_STRUCT(alignment) \
67  __pragma(pack(1)); \
68  struct __declspec(align(alignment))
69 #define STRUCT_END(name, size) \
70  __pragma(pack()); \
71  static_assert(sizeof(name) == size, "compiler breaks packing rules")
72 #elif defined(__GNUC__) || defined(__clang__)
73 #define MANUALLY_ALIGNED_STRUCT(alignment) \
74  _Pragma("pack(1)") struct __attribute__((aligned(alignment)))
75 #define STRUCT_END(name, size) \
76  _Pragma("pack()") static_assert(sizeof(name) == size, "compiler breaks packing rules")
77 #else
78 #error Unknown compiler, please define structure alignment macros
79 #endif
80 #endif // !defined(MANUALLY_ALIGNED_STRUCT)
81 
82 #endif // ARROW_UTIL_MACROS_H