Lines Matching +full:- +full:- +full:ceed
1 // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors.
2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
4 // SPDX-License-Identifier: BSD-2-Clause
6 // This file is part of CEED: http://github.com/ceed
8 #include <ceed-impl.h>
9 #include <ceed.h>
10 #include <ceed/backend.h>
15 /// ----------------------------------------------------------------------------
17 /// ----------------------------------------------------------------------------
24 …Note: This interface takes a `CeedObject` and not a pointer to a `CeedObject` like other `Ceed*Cre…
25 This `CeedObject` will have already been allocated a the first part of the `Ceed*` struct.
26 This function is only intended to be called inside of `Ceed*Create` functions.
28 @param[in] ceed `Ceed` object to reference
29 @param[in] view_function `Ceed*` function for viewing the `obj`
30 @param[in] destroy_function `Ceed*` function for destroying the `obj`
33 @return An error code: 0 - success, otherwise - failure
37 int CeedObjectCreate(Ceed ceed, int (*view_function)(CeedObject, FILE *), int (*destroy_function)(C… in CeedObjectCreate() argument
38 obj->ceed = NULL; in CeedObjectCreate()
39 if (ceed) CeedCall(CeedReferenceCopy(ceed, &obj->ceed)); in CeedObjectCreate()
40 obj->View = view_function; in CeedObjectCreate()
42 obj->Destroy = destroy_function; in CeedObjectCreate()
43 obj->ref_count = 1; in CeedObjectCreate()
52 @return An error code: 0 - success, otherwise - failure
57 obj->ref_count++; in CeedObjectReference()
71 return --obj->ref_count; // prefix notation, to get new number of references in CeedObjectDereference()
79 @return An error code: 0 - success, otherwise - failure
84 CeedCheck(obj->ref_count == 0, CeedObjectReturnCeed(obj), CEED_ERROR_UNSUPPORTED, in CeedObjectDestroy_Private()
86 if (obj->ceed) CeedCall(CeedDestroy(&obj->ceed)); in CeedObjectDestroy_Private()
92 /// ----------------------------------------------------------------------------
94 /// ----------------------------------------------------------------------------
104 @return An error code: 0 - success, otherwise - failure
109 if (obj->View) CeedCall(obj->View(obj, stream)); in CeedObjectView()
119 @return Error code: 0 - success, otherwise - failure
124 …abs >= 0, CeedObjectReturnCeed(obj), CEED_ERROR_MINOR, "Number of view tabs must be non-negative"); in CeedObjectSetNumViewTabs()
125 obj->num_view_tabs = num_tabs; in CeedObjectSetNumViewTabs()
135 @return Error code: 0 - success, otherwise - failure
140 *num_tabs = obj->num_view_tabs; in CeedObjectGetNumViewTabs()
145 @brief Get the `Ceed` associated with a `CeedObject`
148 @param[out] ceed Variable to store `Ceed`
150 @return An error code: 0 - success, otherwise - failure
154 int CeedObjectGetCeed(CeedObject obj, Ceed *ceed) { in CeedObjectGetCeed() argument
155 *ceed = NULL; in CeedObjectGetCeed()
156 CeedCall(CeedReferenceCopy(CeedObjectReturnCeed(obj), ceed)); in CeedObjectGetCeed()
161 @brief Return the `Ceed` associated with a `CeedObject`
165 @return `Ceed` associated with the `basis`
169 Ceed CeedObjectReturnCeed(CeedObject obj) { return (obj->ceed) ? obj->ceed : (Ceed)obj; } in CeedObjectReturnCeed()
176 @return An error code: 0 - success, otherwise - failure
181 CeedCall((*obj)->Destroy(obj)); in CeedObjectDestroy()