blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 5
146
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
7
| license_type
stringclasses 2
values | repo_name
stringlengths 6
79
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 4
values | visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.07k
426M
⌀ | star_events_count
int64 0
27
| fork_events_count
int64 0
12
| gha_license_id
stringclasses 3
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 6
values | src_encoding
stringclasses 26
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 1
class | length_bytes
int64 20
6.28M
| extension
stringclasses 20
values | content
stringlengths 20
6.28M
| authors
sequencelengths 1
16
| author_lines
sequencelengths 1
16
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
faea83e0ca00bc5dd52b3e85324f4f2ac66eae26 | 0466568120485fcabdba5aa22a4b0fea13068b8b | /opencv/modules/stitching/main.cpp | 26226ebe839bd4e9f425521074b50a4810430fc3 | [] | no_license | coapp-packages/opencv | be25a9aec58d9ac890fc764932ba67914add078d | c78981e0d8f602fde523a82c3a7e2c3fef1f39bc | refs/heads/master | 2020-05-17T12:11:25.406742 | 2011-07-14T17:13:01 | 2011-07-14T17:13:01 | 2,048,483 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 22,603 | cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
// We follow to these papers:
// 1) Construction of panoramic mosaics with global and local alignment.
// Heung-Yeung Shum and Richard Szeliski. 2000.
// 2) Eliminating Ghosting and Exposure Artifacts in Image Mosaics.
// Matthew Uyttendaele, Ashley Eden and Richard Szeliski. 2001.
// 3) Automatic Panoramic Image Stitching using Invariant Features.
// Matthew Brown and David G. Lowe. 2007.
#include "precomp.hpp"
#include "util.hpp"
#include "warpers.hpp"
#include "blenders.hpp"
#include "seam_finders.hpp"
#include "motion_estimators.hpp"
#include "exposure_compensate.hpp"
using namespace std;
using namespace cv;
void printUsage()
{
cout <<
"Rotation model images stitcher.\n\n"
"opencv_stitching img1 img2 [...imgN] [flags]\n\n"
"Flags:\n"
" --preview\n"
" Run stitching in the preview mode. Works faster than usual mode,\n"
" but output image will have lower resolution.\n"
" --try_gpu (yes|no)\n"
" Try to use GPU. The default value is 'no'. All default values\n"
" are for CPU mode.\n"
"\nMotion Estimation Flags:\n"
" --work_megapix <float>\n"
" Resolution for image registration step. The default is 0.6 Mpx.\n"
" --match_conf <float>\n"
" Confidence for feature matching step. The default is 0.65.\n"
" --conf_thresh <float>\n"
" Threshold for two images are from the same panorama confidence.\n"
" The default is 1.0.\n"
" --ba (ray|focal_ray)\n"
" Bundle adjustment cost function. The default is 'focal_ray'.\n"
" --wave_correct (no|yes)\n"
" Perform wave effect correction. The default is 'yes'.\n"
"\nCompositing Flags:\n"
" --warp (plane|cylindrical|spherical)\n"
" Warp surface type. The default is 'spherical'.\n"
" --seam_megapix <float>\n"
" Resolution for seam estimation step. The default is 0.1 Mpx.\n"
" --seam (no|voronoi|gc_color|gc_colorgrad)\n"
" Seam estimation method. The default is 'gc_color'.\n"
" --compose_megapix <float>\n"
" Resolution for compositing step. Use -1 for original resolution.\n"
" The default is -1.\n"
" --expos_comp (no|gain|gain_blocks)\n"
" Exposure compensation method. The default is 'gain_blocks'.\n"
" --blend (no|feather|multiband)\n"
" Blending method. The default is 'multiband'.\n"
" --blend_strength <float>\n"
" Blending strength from [0,100] range. The default is 5.\n"
" --output <result_img>\n"
" The default is 'result.png'.\n";
}
// Default command line args
vector<string> img_names;
bool preview = false;
bool try_gpu = false;
double work_megapix = 0.6;
double seam_megapix = 0.1;
double compose_megapix = -1;
int ba_space = BundleAdjuster::FOCAL_RAY_SPACE;
float conf_thresh = 1.f;
bool wave_correct = true;
int warp_type = Warper::SPHERICAL;
int expos_comp_type = ExposureCompensator::GAIN_BLOCKS;
float match_conf = 0.65f;
int seam_find_type = SeamFinder::GC_COLOR;
int blend_type = Blender::MULTI_BAND;
float blend_strength = 5;
string result_name = "result.png";
int parseCmdArgs(int argc, char** argv)
{
if (argc == 1)
{
printUsage();
return -1;
}
for (int i = 1; i < argc; ++i)
{
if (string(argv[i]) == "--help" || string(argv[i]) == "/?")
{
printUsage();
return -1;
}
else if (string(argv[i]) == "--preview")
{
preview = true;
}
else if (string(argv[i]) == "--try_gpu")
{
if (string(argv[i + 1]) == "no")
try_gpu = false;
else if (string(argv[i + 1]) == "yes")
try_gpu = true;
else
{
cout << "Bad --try_gpu flag value\n";
return -1;
}
i++;
}
else if (string(argv[i]) == "--work_megapix")
{
work_megapix = atof(argv[i + 1]);
i++;
}
else if (string(argv[i]) == "--seam_megapix")
{
seam_megapix = atof(argv[i + 1]);
i++;
}
else if (string(argv[i]) == "--compose_megapix")
{
compose_megapix = atof(argv[i + 1]);
i++;
}
else if (string(argv[i]) == "--result")
{
result_name = argv[i + 1];
i++;
}
else if (string(argv[i]) == "--match_conf")
{
match_conf = static_cast<float>(atof(argv[i + 1]));
i++;
}
else if (string(argv[i]) == "--ba")
{
if (string(argv[i + 1]) == "ray")
ba_space = BundleAdjuster::RAY_SPACE;
else if (string(argv[i + 1]) == "focal_ray")
ba_space = BundleAdjuster::FOCAL_RAY_SPACE;
else
{
cout << "Bad bundle adjustment space\n";
return -1;
}
i++;
}
else if (string(argv[i]) == "--conf_thresh")
{
conf_thresh = static_cast<float>(atof(argv[i + 1]));
i++;
}
else if (string(argv[i]) == "--wave_correct")
{
if (string(argv[i + 1]) == "no")
wave_correct = false;
else if (string(argv[i + 1]) == "yes")
wave_correct = true;
else
{
cout << "Bad --wave_correct flag value\n";
return -1;
}
i++;
}
else if (string(argv[i]) == "--warp")
{
if (string(argv[i + 1]) == "plane")
warp_type = Warper::PLANE;
else if (string(argv[i + 1]) == "cylindrical")
warp_type = Warper::CYLINDRICAL;
else if (string(argv[i + 1]) == "spherical")
warp_type = Warper::SPHERICAL;
else
{
cout << "Bad warping method\n";
return -1;
}
i++;
}
else if (string(argv[i]) == "--expos_comp")
{
if (string(argv[i + 1]) == "no")
expos_comp_type = ExposureCompensator::NO;
else if (string(argv[i + 1]) == "gain")
expos_comp_type = ExposureCompensator::GAIN;
else if (string(argv[i + 1]) == "gain_blocks")
expos_comp_type = ExposureCompensator::GAIN_BLOCKS;
else
{
cout << "Bad exposure compensation method\n";
return -1;
}
i++;
}
else if (string(argv[i]) == "--seam")
{
if (string(argv[i + 1]) == "no")
seam_find_type = SeamFinder::NO;
else if (string(argv[i + 1]) == "voronoi")
seam_find_type = SeamFinder::VORONOI;
else if (string(argv[i + 1]) == "gc_color")
seam_find_type = SeamFinder::GC_COLOR;
else if (string(argv[i + 1]) == "gc_colorgrad")
seam_find_type = SeamFinder::GC_COLOR_GRAD;
else
{
cout << "Bad seam finding method\n";
return -1;
}
i++;
}
else if (string(argv[i]) == "--blend")
{
if (string(argv[i + 1]) == "no")
blend_type = Blender::NO;
else if (string(argv[i + 1]) == "feather")
blend_type = Blender::FEATHER;
else if (string(argv[i + 1]) == "multiband")
blend_type = Blender::MULTI_BAND;
else
{
cout << "Bad blending method\n";
return -1;
}
i++;
}
else if (string(argv[i]) == "--blend_strength")
{
blend_strength = static_cast<float>(atof(argv[i + 1]));
i++;
}
else if (string(argv[i]) == "--output")
{
result_name = argv[i + 1];
i++;
}
else
img_names.push_back(argv[i]);
}
if (preview)
{
compose_megapix = 0.6;
}
return 0;
}
int main(int argc, char* argv[])
{
int64 app_start_time = getTickCount();
cv::setBreakOnError(true);
int retval = parseCmdArgs(argc, argv);
if (retval)
return retval;
// Check if have enough images
int num_images = static_cast<int>(img_names.size());
if (num_images < 2)
{
LOGLN("Need more images");
return -1;
}
double work_scale = 1, seam_scale = 1, compose_scale = 1;
bool is_work_scale_set = false, is_seam_scale_set = false, is_compose_scale_set = false;
LOGLN("Finding features...");
int64 t = getTickCount();
vector<ImageFeatures> features(num_images);
SurfFeaturesFinder finder(try_gpu);
Mat full_img, img;
vector<Mat> images(num_images);
vector<Size> full_img_sizes(num_images);
double seam_work_aspect = 1;
for (int i = 0; i < num_images; ++i)
{
full_img = imread(img_names[i]);
full_img_sizes[i] = full_img.size();
if (full_img.empty())
{
LOGLN("Can't open image " << img_names[i]);
return -1;
}
if (work_megapix < 0)
{
img = full_img;
work_scale = 1;
is_work_scale_set = true;
}
else
{
if (!is_work_scale_set)
{
work_scale = min(1.0, sqrt(work_megapix * 1e6 / full_img.size().area()));
is_work_scale_set = true;
}
resize(full_img, img, Size(), work_scale, work_scale);
}
if (!is_seam_scale_set)
{
seam_scale = min(1.0, sqrt(seam_megapix * 1e6 / full_img.size().area()));
seam_work_aspect = seam_scale / work_scale;
is_seam_scale_set = true;
}
finder(img, features[i]);
features[i].img_idx = i;
LOGLN("Features in image #" << i+1 << ": " << features[i].keypoints.size());
resize(full_img, img, Size(), seam_scale, seam_scale);
images[i] = img.clone();
}
full_img.release();
img.release();
LOGLN("Finding features, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");
LOG("Pairwise matching");
t = getTickCount();
vector<MatchesInfo> pairwise_matches;
BestOf2NearestMatcher matcher(try_gpu, match_conf);
matcher(features, pairwise_matches);
LOGLN("Pairwise matching, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");
// Leave only images we are sure are from the same panorama
vector<int> indices = leaveBiggestComponent(features, pairwise_matches, conf_thresh);
vector<Mat> img_subset;
vector<string> img_names_subset;
vector<Size> full_img_sizes_subset;
for (size_t i = 0; i < indices.size(); ++i)
{
img_names_subset.push_back(img_names[indices[i]]);
img_subset.push_back(images[indices[i]]);
full_img_sizes_subset.push_back(full_img_sizes[indices[i]]);
}
images = img_subset;
img_names = img_names_subset;
full_img_sizes = full_img_sizes_subset;
// Check if we still have enough images
num_images = static_cast<int>(img_names.size());
if (num_images < 2)
{
LOGLN("Need more images");
return -1;
}
LOGLN("Estimating rotations...");
t = getTickCount();
HomographyBasedEstimator estimator;
vector<CameraParams> cameras;
estimator(features, pairwise_matches, cameras);
LOGLN("Estimating rotations, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");
for (size_t i = 0; i < cameras.size(); ++i)
{
Mat R;
cameras[i].R.convertTo(R, CV_32F);
cameras[i].R = R;
LOGLN("Initial focal length #" << indices[i]+1 << ": " << cameras[i].focal);
}
LOG("Bundle adjustment");
t = getTickCount();
BundleAdjuster adjuster(ba_space, conf_thresh);
adjuster(features, pairwise_matches, cameras);
LOGLN("Bundle adjustment, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");
// Find median focal length
vector<double> focals;
for (size_t i = 0; i < cameras.size(); ++i)
{
LOGLN("Camera #" << indices[i]+1 << " focal length: " << cameras[i].focal);
focals.push_back(cameras[i].focal);
}
nth_element(focals.begin(), focals.begin() + focals.size()/2, focals.end());
float warped_image_scale = static_cast<float>(focals[focals.size() / 2]);
if (wave_correct)
{
LOGLN("Wave correcting...");
t = getTickCount();
vector<Mat> rmats;
for (size_t i = 0; i < cameras.size(); ++i)
rmats.push_back(cameras[i].R);
waveCorrect(rmats);
for (size_t i = 0; i < cameras.size(); ++i)
cameras[i].R = rmats[i];
LOGLN("Wave correcting, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");
}
LOGLN("Warping images (auxiliary)... ");
t = getTickCount();
vector<Point> corners(num_images);
vector<Mat> masks_warped(num_images);
vector<Mat> images_warped(num_images);
vector<Size> sizes(num_images);
vector<Mat> masks(num_images);
// Preapre images masks
for (int i = 0; i < num_images; ++i)
{
masks[i].create(images[i].size(), CV_8U);
masks[i].setTo(Scalar::all(255));
}
// Warp images and their masks
Ptr<Warper> warper = Warper::createByCameraFocal(static_cast<float>(warped_image_scale * seam_work_aspect),
warp_type, try_gpu);
for (int i = 0; i < num_images; ++i)
{
corners[i] = warper->warp(images[i], static_cast<float>(cameras[i].focal * seam_work_aspect),
cameras[i].R, images_warped[i]);
sizes[i] = images_warped[i].size();
warper->warp(masks[i], static_cast<float>(cameras[i].focal * seam_work_aspect),
cameras[i].R, masks_warped[i], INTER_NEAREST, BORDER_CONSTANT);
}
vector<Mat> images_warped_f(num_images);
for (int i = 0; i < num_images; ++i)
images_warped[i].convertTo(images_warped_f[i], CV_32F);
LOGLN("Warping images, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");
LOGLN("Exposure compensation (feed)...");
t = getTickCount();
Ptr<ExposureCompensator> compensator = ExposureCompensator::createDefault(expos_comp_type);
compensator->feed(corners, images_warped, masks_warped);
LOGLN("Exposure compensation (feed), time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");
LOGLN("Finding seams...");
t = getTickCount();
Ptr<SeamFinder> seam_finder = SeamFinder::createDefault(seam_find_type);
seam_finder->find(images_warped_f, corners, masks_warped);
LOGLN("Finding seams, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");
// Release unused memory
images.clear();
images_warped.clear();
images_warped_f.clear();
masks.clear();
LOGLN("Compositing...");
t = getTickCount();
Mat img_warped, img_warped_s;
Mat dilated_mask, seam_mask, mask, mask_warped;
Ptr<Blender> blender;
double compose_seam_aspect = 1;
double compose_work_aspect = 1;
for (int img_idx = 0; img_idx < num_images; ++img_idx)
{
LOGLN("Compositing image #" << indices[img_idx]+1);
// Read image and resize it if necessary
full_img = imread(img_names[img_idx]);
if (!is_compose_scale_set)
{
if (compose_megapix > 0)
compose_scale = min(1.0, sqrt(compose_megapix * 1e6 / full_img.size().area()));
is_compose_scale_set = true;
// Compute relative scales
compose_seam_aspect = compose_scale / seam_scale;
compose_work_aspect = compose_scale / work_scale;
// Update warped image scale
warped_image_scale *= static_cast<float>(compose_work_aspect);
warper = Warper::createByCameraFocal(warped_image_scale, warp_type, try_gpu);
// Update corners and sizes
for (int i = 0; i < num_images; ++i)
{
// Update camera focal
cameras[i].focal *= compose_work_aspect;
// Update corner and size
Size sz = full_img_sizes[i];
if (abs(compose_scale - 1) > 1e-1)
{
sz.width = cvRound(full_img_sizes[i].width * compose_scale);
sz.height = cvRound(full_img_sizes[i].height * compose_scale);
}
Rect roi = warper->warpRoi(sz, static_cast<float>(cameras[i].focal), cameras[i].R);
corners[i] = roi.tl();
sizes[i] = roi.size();
}
}
if (abs(compose_scale - 1) > 1e-1)
resize(full_img, img, Size(), compose_scale, compose_scale);
else
img = full_img;
full_img.release();
Size img_size = img.size();
// Warp the current image
warper->warp(img, static_cast<float>(cameras[img_idx].focal), cameras[img_idx].R,
img_warped);
// Warp the current image mask
mask.create(img_size, CV_8U);
mask.setTo(Scalar::all(255));
warper->warp(mask, static_cast<float>(cameras[img_idx].focal), cameras[img_idx].R, mask_warped,
INTER_NEAREST, BORDER_CONSTANT);
// Compensate exposure
compensator->apply(img_idx, corners[img_idx], img_warped, mask_warped);
img_warped.convertTo(img_warped_s, CV_16S);
img_warped.release();
img.release();
mask.release();
dilate(masks_warped[img_idx], dilated_mask, Mat());
resize(dilated_mask, seam_mask, mask_warped.size());
mask_warped = seam_mask & mask_warped;
if (static_cast<Blender*>(blender) == 0)
{
blender = Blender::createDefault(blend_type, try_gpu);
Size dst_sz = resultRoi(corners, sizes).size();
float blend_width = sqrt(static_cast<float>(dst_sz.area())) * blend_strength / 100.f;
if (blend_width < 1.f)
blender = Blender::createDefault(Blender::NO, try_gpu);
else if (blend_type == Blender::MULTI_BAND)
{
MultiBandBlender* mb = dynamic_cast<MultiBandBlender*>(static_cast<Blender*>(blender));
mb->setNumBands(static_cast<int>(ceil(log(blend_width)/log(2.)) - 1.));
LOGLN("Multi-band blender, number of bands: " << mb->numBands());
}
else if (blend_type == Blender::FEATHER)
{
FeatherBlender* fb = dynamic_cast<FeatherBlender*>(static_cast<Blender*>(blender));
fb->setSharpness(1.f/blend_width);
LOGLN("Feather blender, number of bands: " << fb->sharpness());
}
blender->prepare(corners, sizes);
}
// Blend the current image
blender->feed(img_warped_s, mask_warped, corners[img_idx]);
}
Mat result, result_mask;
blender->blend(result, result_mask);
LOGLN("Compositing, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");
imwrite(result_name, result);
LOGLN("Finished, total time: " << ((getTickCount() - app_start_time) / getTickFrequency()) << " sec");
return 0;
}
| [
"alexeys@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08",
"vinogradov_vlad@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08"
] | [
[
[
1,
51
],
[
57,
57
],
[
62,
62
],
[
64,
103
],
[
107,
126
],
[
129,
130
],
[
132,
171
],
[
176,
176
],
[
178,
178
],
[
183,
183
],
[
185,
185
],
[
194,
211
],
[
227,
241
],
[
248,
251
],
[
274,
278
],
[
285,
285
],
[
287,
292
],
[
294,
305
],
[
308,
308
],
[
312,
369
],
[
371,
372
],
[
374,
376
],
[
378,
401
],
[
403,
403
],
[
406,
407
],
[
412,
414
],
[
417,
421
],
[
423,
452
],
[
454,
455
],
[
462,
464
],
[
467,
471
],
[
473,
474
],
[
476,
478
],
[
480,
487
],
[
489,
490
],
[
492,
603
],
[
607,
607
],
[
610,
611
]
],
[
[
52,
56
],
[
58,
61
],
[
63,
63
],
[
104,
106
],
[
127,
128
],
[
131,
131
],
[
172,
175
],
[
177,
177
],
[
179,
182
],
[
184,
184
],
[
186,
193
],
[
212,
226
],
[
242,
247
],
[
252,
273
],
[
279,
284
],
[
286,
286
],
[
293,
293
],
[
306,
307
],
[
309,
311
],
[
370,
370
],
[
373,
373
],
[
377,
377
],
[
402,
402
],
[
404,
405
],
[
408,
411
],
[
415,
416
],
[
422,
422
],
[
453,
453
],
[
456,
461
],
[
465,
466
],
[
472,
472
],
[
475,
475
],
[
479,
479
],
[
488,
488
],
[
491,
491
],
[
604,
606
],
[
608,
609
]
]
] |
b35d74f4a9a7846d37c76e3a41d67b82fdd60157 | 26706a661c23f5c2c1f97847ba09f44b7b425cf6 | /TaskManager/ProcessCPUUsage.cpp | bc4af4fdc88cb7b2263a5e96ae01163247c1a44f | [] | no_license | 124327288/nativetaskmanager | 96a54dbe150f855422d7fd813d3631eaac76fadd | e75b3d9d27c902baddbb1bef975c746451b1b8bb | refs/heads/master | 2021-05-29T05:18:26.779900 | 2009-02-10T13:23:28 | 2009-02-10T13:23:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 357 | cpp | #include "stdafx.h"
//int main(void)
//{
// PerfDataInitialize();
// while(1)
// {
// GetAllProcCPUUsage();
// printf("PID:0 CPU:%u\n",PerfDataGetCPUUsage(0));
// printf("PID:4 CPU:%u\n",PerfDataGetCPUUsage(4));
// printf("PID:4032 CPU:%u\n\n\n\n\n\n\n\n\n",PerfDataGetCPUUsage(3660));
// Sleep(1000);
// }
// return 0;
//}
| [
"[email protected]@97a26042-f463-11dd-a7be-4b3ef3b0700c"
] | [
[
[
1,
18
]
]
] |
6673ae312d7915a922ee182d5d1dcc179f373fa5 | 4d5ee0b6f7be0c3841c050ed1dda88ec128ae7b4 | /src/nvimage/BlockDXT.h | ba7795430bb9d17fcb0626ba91e3564a5a05b601 | [] | no_license | saggita/nvidia-mesh-tools | 9df27d41b65b9742a9d45dc67af5f6835709f0c2 | a9b7fdd808e6719be88520e14bc60d58ea57e0bd | refs/heads/master | 2020-12-24T21:37:11.053752 | 2010-09-03T01:39:02 | 2010-09-03T01:39:02 | 56,893,300 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 5,393 | h | // Copyright NVIDIA Corporation 2007 -- Ignacio Castano <[email protected]>
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
#ifndef NV_IMAGE_BLOCKDXT_H
#define NV_IMAGE_BLOCKDXT_H
#include <nvmath/Color.h>
#include <nvimage/nvimage.h>
namespace nv
{
struct ColorBlock;
class Stream;
/// DXT1 block.
struct BlockDXT1
{
Color16 col0;
Color16 col1;
union {
uint8 row[4];
uint indices;
};
bool isFourColorMode() const;
uint evaluatePalette(Color32 color_array[4]) const;
uint evaluatePaletteNV5x(Color32 color_array[4]) const;
void evaluatePalette3(Color32 color_array[4]) const;
void evaluatePalette4(Color32 color_array[4]) const;
void decodeBlock(ColorBlock * block) const;
void setIndices(int * idx);
void flip4();
void flip2();
};
/// Return true if the block uses four color mode, false otherwise.
inline bool BlockDXT1::isFourColorMode() const
{
return col0.u > col1.u;
}
/// DXT3 alpha block with explicit alpha.
struct AlphaBlockDXT3
{
union {
struct {
uint alpha0 : 4;
uint alpha1 : 4;
uint alpha2 : 4;
uint alpha3 : 4;
uint alpha4 : 4;
uint alpha5 : 4;
uint alpha6 : 4;
uint alpha7 : 4;
uint alpha8 : 4;
uint alpha9 : 4;
uint alphaA : 4;
uint alphaB : 4;
uint alphaC : 4;
uint alphaD : 4;
uint alphaE : 4;
uint alphaF : 4;
};
uint16 row[4];
};
void decodeBlock(ColorBlock * block) const;
void flip4();
void flip2();
};
/// DXT3 block.
struct BlockDXT3
{
AlphaBlockDXT3 alpha;
BlockDXT1 color;
void decodeBlock(ColorBlock * block) const;
void flip4();
void flip2();
};
/// DXT5 alpha block.
struct AlphaBlockDXT5
{
union {
struct {
uint64 alpha0 : 8; // 8
uint64 alpha1 : 8; // 16
uint64 bits0 : 3; // 3 - 19
uint64 bits1 : 3; // 6 - 22
uint64 bits2 : 3; // 9 - 25
uint64 bits3 : 3; // 12 - 28
uint64 bits4 : 3; // 15 - 31
uint64 bits5 : 3; // 18 - 34
uint64 bits6 : 3; // 21 - 37
uint64 bits7 : 3; // 24 - 40
uint64 bits8 : 3; // 27 - 43
uint64 bits9 : 3; // 30 - 46
uint64 bitsA : 3; // 33 - 49
uint64 bitsB : 3; // 36 - 52
uint64 bitsC : 3; // 39 - 55
uint64 bitsD : 3; // 42 - 58
uint64 bitsE : 3; // 45 - 61
uint64 bitsF : 3; // 48 - 64
};
uint64 u;
};
void evaluatePalette(uint8 alpha[8]) const;
void evaluatePalette8(uint8 alpha[8]) const;
void evaluatePalette6(uint8 alpha[8]) const;
void indices(uint8 index_array[16]) const;
uint index(uint index) const;
void setIndex(uint index, uint value);
void decodeBlock(ColorBlock * block) const;
void flip4();
void flip2();
};
/// DXT5 block.
struct BlockDXT5
{
AlphaBlockDXT5 alpha;
BlockDXT1 color;
void decodeBlock(ColorBlock * block) const;
void flip4();
void flip2();
};
/// ATI1 block.
struct BlockATI1
{
AlphaBlockDXT5 alpha;
void decodeBlock(ColorBlock * block) const;
void flip4();
void flip2();
};
/// ATI2 block.
struct BlockATI2
{
AlphaBlockDXT5 x;
AlphaBlockDXT5 y;
void decodeBlock(ColorBlock * block) const;
void flip4();
void flip2();
};
/// CTX1 block.
struct BlockCTX1
{
uint8 col0[2];
uint8 col1[2];
union {
uint8 row[4];
uint indices;
};
void evaluatePalette(Color32 color_array[4]) const;
void setIndices(int * idx);
void decodeBlock(ColorBlock * block) const;
void flip4();
void flip2();
};
// Serialization functions.
NVIMAGE_API Stream & operator<<(Stream & stream, BlockDXT1 & block);
NVIMAGE_API Stream & operator<<(Stream & stream, AlphaBlockDXT3 & block);
NVIMAGE_API Stream & operator<<(Stream & stream, BlockDXT3 & block);
NVIMAGE_API Stream & operator<<(Stream & stream, AlphaBlockDXT5 & block);
NVIMAGE_API Stream & operator<<(Stream & stream, BlockDXT5 & block);
NVIMAGE_API Stream & operator<<(Stream & stream, BlockATI1 & block);
NVIMAGE_API Stream & operator<<(Stream & stream, BlockATI2 & block);
NVIMAGE_API Stream & operator<<(Stream & stream, BlockCTX1 & block);
} // nv namespace
#endif // NV_IMAGE_BLOCKDXT_H
| [
"castano@0f2971b0-9fc2-11dd-b4aa-53559073bf4c"
] | [
[
[
1,
224
]
]
] |
6f9f1668c114cc72fddaba114451454e6ac113b2 | e02fa80eef98834bf8a042a09d7cb7fe6bf768ba | /MyGUIEngine/include/MyGUI_ProgressFactory.h | 8483d3cfe135af501e39a5f8a53df8c131d3f694 | [] | no_license | MyGUI/mygui-historical | fcd3edede9f6cb694c544b402149abb68c538673 | 4886073fd4813de80c22eded0b2033a5ba7f425f | refs/heads/master | 2021-01-23T16:40:19.477150 | 2008-03-06T22:19:12 | 2008-03-06T22:19:12 | 22,805,225 | 2 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 1,131 | h | /*!
@file
@author Albert Semenov
@date 01/2008
@module
*/
#ifndef __MYGUI_PROGRESS_FACTORY_H__
#define __MYGUI_PROGRESS_FACTORY_H__
#include "MyGUI_Prerequest.h"
#include "MyGUI_WidgetFactoryInterface.h"
#include "MyGUI_WidgetDefines.h"
namespace MyGUI
{
namespace factory
{
class _MyGUIExport ProgressFactory : public WidgetFactoryInterface
{
public:
ProgressFactory();
~ProgressFactory();
// реализация интерфейса фабрики
const Ogre::String& getType();
WidgetPtr createWidget(const Ogre::String& _skin, const IntCoord& _coord, Align _align, CroppedRectanglePtr _parent, const Ogre::String& _name);
// методы для парсинга
void Progress_Range(WidgetPtr _widget, const Ogre::String &_key, const Ogre::String &_value);
void Progress_Position(WidgetPtr _widget, const Ogre::String &_key, const Ogre::String &_value);
void Progress_AutoTrack(WidgetPtr _widget, const Ogre::String &_key, const Ogre::String &_value);
};
} // namespace factory
} // namespace MyGUI
#endif // __MYGUI_PROGRESS_FACTORY_H__
| [
"[email protected]"
] | [
[
[
1,
38
]
]
] |
455798e78bd6a04d9716497c55ddf83c4c683d1d | d8f64a24453c6f077426ea58aaa7313aafafc75c | /GUI/MainMenu.cpp | fb564b213c2294354ae5f926dcf05718b4d34c90 | [] | no_license | dotted/wfto | 5b98591645f3ddd72cad33736da5def09484a339 | 6eebb66384e6eb519401bdd649ae986d94bcaf27 | refs/heads/master | 2021-01-20T06:25:20.468978 | 2010-11-04T21:01:51 | 2010-11-04T21:01:51 | 32,183,921 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,222 | cpp | #include "MainMenu.h"
namespace DK_GUI
{
CMainMenu::CMainMenu(GLint screen_width, GLint screen_height, CDKTextureList *game_textures)
{
selected_menu=SM_MAIN;
GLuint menu_button = game_textures->get_texture_by_name("MENU_BUTTON");
GLuint menu_button_effect = game_textures->get_texture_by_name("MENU_BUTTON_EFFECT");
GLuint main_menu_background = game_textures->get_texture_by_name("MAIN_MENU_BACKGROUND");
GLfloat button_width = 0.58f;
GLfloat button_height = 0.078f;
main_menu = new CGUI(screen_width,screen_height);
main_menu->add_item(new CGUIBackground(0.0f,0.0f,0.0f,1.0f,1.0f,main_menu_background));
main_menu->add_item(new CMenuButton(0.0f,0.072f,0.0f,button_width,button_height,"Main menu",menu_button,menu_button_effect));
main_menu->add_item(new CMenuButton(0.0f,0.224f,0.0f,button_width,button_height,"Start New Game",menu_button,menu_button_effect));
main_menu->add_item(new CMenuButton(0.0f,0.329f,0.0f,button_width,button_height,"Continue Game",menu_button,menu_button_effect));
main_menu->add_item(new CMenuButton(0.0f,0.435f,0.0f,button_width,button_height,"Load Game",menu_button,menu_button_effect));
main_menu->add_item(new CMenuButton(0.0f,0.536f,0.0f,button_width,button_height,"Multiplayer",menu_button,menu_button_effect));
main_menu->add_item(new CMenuButton(0.0f,0.645f,0.0f,button_width,button_height,"Options",menu_button,menu_button_effect));
main_menu->add_item(new CMenuButton(0.0f,0.746f,0.0f,button_width,button_height,"High Score Table",menu_button,menu_button_effect));
main_menu->add_item(new CMenuButton(0.0f,0.848f,0.0f,button_width,button_height,"Quit",menu_button,menu_button_effect));
main_menu->init();
main_menu->force_vertical_alignment();
menus[0]=main_menu;
menus[1]=main_menu_new_game_continue;
menus[2]=main_menu_load_game;
menus[3]=main_menu_multiplayer;
menus[4]=main_menu_options;
menus[5]=main_menu_high_score_table;
}
CMainMenu::~CMainMenu()
{
delete main_menu;
}
GLvoid CMainMenu::draw_and_do_actions()
{
menus[selected_menu]->draw();
menus[selected_menu]->do_actions();
}
CGUI *CMainMenu::get_active_gui()
{
return menus[selected_menu];
}
} | [
"[email protected]"
] | [
[
[
1,
52
]
]
] |
e434dbecc88e18f3554da0796062eb79d2cade78 | 197ac28d1481843225f35aff4aa85f1909ef36bf | /mcucpp/format_parser.h | 5ca613769461653c93904b7a36f2f7126bd6305d | [
"BSD-3-Clause"
] | permissive | xandroalmeida/Mcucpp | 831e1088eb38dfcf65bfb6fb3205d4448666983c | 6fc5c8d5b9839ade60b3f57acc78a0ed63995fca | refs/heads/master | 2020-12-24T12:13:53.497692 | 2011-11-21T15:36:03 | 2011-11-21T15:36:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,178 | h | #pragma once
#include <tiny_iomainp.h>
namespace IO
{
enum FormatMode
{
FmMinimal,
FmNormal,
FmFull
};
template<class Stream, FormatMode Mode = FmNormal, class FormatStrPtrType = char *>
class FormatParser
{
static const bool ScanFloatPrecision = Mode == FmFull;
static const bool ScanFieldWidth = (Mode == FmNormal || Mode == FmFull);
static const bool ScanFlags = (Mode == FmNormal || Mode == FmFull);
FormatStrPtrType _formatSrting;
typedef FormatParser Self;
public:
Stream & out;
private:
void inline ClearFmt()
{
out.setf(Stream::right | Stream::dec, Stream::unitbuf | Stream::showpos |
Stream::boolalpha | Stream::adjustfield |
Stream::basefield | Stream::floatfield |
Stream::skipws | Stream::showbase |
Stream::showpoint | Stream::uppercase);
}
inline void ProcessFormat();
public:
FormatParser(Stream &stream, FormatStrPtrType format)
:out(stream),
_formatSrting(format)
{
if(_formatSrting)
ProcessFormat();
}
Self&
operator% (Stream& (*__pf)(Stream&))
{
__pf(out);
return *this;
}
Self&
operator% (SetwT f)
{
out.width(f.width);
return *this;
}
template<class T>
Self& operator % (T value)
{
if(_formatSrting)
{
out << value;
ProcessFormat();
}
return *this;
}
};
template< FormatMode Mode, class FormatStr>
struct FormatT
{
FormatStr FormatSrting;
FormatT(FormatStr formatSrting)
:FormatSrting(formatSrting)
{}
};
template<FormatMode Mode, class FormatStr>
FormatT<Mode, FormatStr> Format(FormatStr formatStr)
{
return FormatT<Mode, FormatStr>(formatStr);
}
template<class FormatStr>
FormatT<FmNormal, FormatStr> Format(FormatStr formatStr)
{
return FormatT<FmNormal, FormatStr>(formatStr);
}
template<class Stream, FormatMode Mode, class FormatStr>
FormatParser<Stream, Mode, FormatStr> operator% (Stream &stream, FormatT<Mode, FormatStr> format)
{
return FormatParser<Stream, Mode, FormatStr>(stream, format.FormatSrting);
}
}
#include <impl/format_parser.h>
| [
"[email protected]"
] | [
[
[
1,
101
]
]
] |
391080df08ce7a97378693fe1d91332dd28e6364 | 6bdb3508ed5a220c0d11193df174d8c215eb1fce | /Codes/Halak/UIGamePadEventArgs.cpp | bc6c566fdca7fbe03063510a36d61fb2afd41e83 | [] | no_license | halak/halak-plusplus | d09ba78640c36c42c30343fb10572c37197cfa46 | fea02a5ae52c09ff9da1a491059082a34191cd64 | refs/heads/master | 2020-07-14T09:57:49.519431 | 2011-07-09T14:48:07 | 2011-07-09T14:48:07 | 66,716,624 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 209 | cpp | #include <Halak/PCH.h>
#include <Halak/UIGamePadEventArgs.h>
namespace Halak
{
UIGamePadEventArgs::UIGamePadEventArgs()
{
}
UIGamePadEventArgs::~UIGamePadEventArgs()
{
}
} | [
"[email protected]"
] | [
[
[
1,
13
]
]
] |
ee483428378b1ed8a2dc4a5f6e2d881deacc58b7 | 9b75c1c40dbeda4e9d393278d38a36a61484a5b6 | /cpp files to be pasted in INCLUDE directory/PROJECT2.CPP | 0b9b4a59dcf6a577aa8c3a86af63cfd6d0c10241 | [] | no_license | yeskarthik/Project-Shark | b5fe9f14913618f0205c4a82003e466da52f7929 | 042869cd69b60e958c65de2a17b0bd34612e28dc | refs/heads/master | 2020-05-22T13:49:42.317314 | 2011-04-06T06:35:21 | 2011-04-06T06:35:21 | 1,575,801 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,305 | cpp |
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<paint.cpp>
#include<piano.cpp>
#include<primes.cpp>
#include<bally.cpp>
#include<ballyy.cpp>
#include<puzzle.cpp>
#include<sparkal.cpp>
#include<fade.cpp>
#include<intro.cpp>
int tim=1;
void main();
void menumain();
void border();
void arrow(int);
void move(char);
float ii=125;
char ch;
void introd()
{
int x,y,j,c,e,g,da;
cleardevice();
for(int ii=0;ii<=210;ii++)
{
sound(ii*10);
c=random(12);
setcolor(c);
circle(320,240,ii);
delay(50);
setcolor(BLACK);
circle(320,240,ii);
nosound();
}
for(int r=0;r<=640;r+=50)
{
sound(r+40);
setcolor(3);
line(1,r,640,r);
line(r,1,r,640);
line(1,1,840,640);
line(650,1,1,480);
delay(80);
nosound();
}
for(int t=0;t<=230;t+=8)
{
sound(t*10);
setcolor(3);
circle(320,240,t);
setcolor(3);
ellipse(320,240,0,360,t,80);
ellipse(320,240,0,360,80,t);
delay(80);
nosound();
}
for(int z=0;z<80;z++)
{
sound(500+z);
da=random(12);
setcolor(da);
circle(320,240,z);
delay(50);
nosound();
}
for(int q=80;q<340;q++)
{
sound(500*q);
setcolor(0);
circle(320,240,q);
delay(50);
nosound();
}
do
{
j=random(12);
setcolor(j);
settextstyle(3,0,6);
outtextxy(250,330,"SRIRAM");
outtextxy(240,80,"KARTHIK");
settextstyle(3,1,6);
outtextxy(150,140,"DEEPAK");
outtextxy(430,140,"SRIHARI");
}while(!kbhit());
getch();
}
void main()
{
clrscr();
int a=0,b,flag=0;
initgraph(&a,&b,"d:\\tc1\\bgi");
//if(tim==1)introd();
tim++;
cleardevice();
if(flag==0)
{
flag=1;
cleardevice();
}
menumain();
}
void menumain()
{
cleardevice();
setcolor(GREEN);
cleardevice();
border();
settextstyle(11,HORIZ_DIR,2);
outtextxy(50,125,"1.Sharx Music");
outtextxy(50,150,"2.Shark Draw");
outtextxy(50,175,"3.Puzzle");
outtextxy(50,200,"4.Bally");
outtextxy(50,225,"5.Reflex");
outtextxy(50,250,"6.Exit");
setcolor(RED);
arrow(ii);
while(ch!='q')
{
ch=getch();
move(ch);
}
}
int q=0;//160
int w=0;//10
void arrow(int k)
{
line(q+15,k,q+35,k);
line(q+35,k,q+25,k-5);
line(q+35,k,q+25,k+5);
}
void move(char ch)
{
int a=RED,b=YELLOW;
if (ch==13)
{
if(q==0)
{
if (ii==125)
{
eff3(&a,&b);
pianomain();
}
if (ii==150)
{
a++;b++;
eff2(&a,&b);
paintmain();
}
if (ii==175)
{
a++;b++;
eff2(&a,&b);
puzzlemain();
}
if (ii==200)
{
a++;b++;
eff2(&a,&b);
ballymain();
}
if (ii==250)
{
a++;b++;
eff2(&a,&b);
exit(0);
}
if (ii==225)
{ a++;b++;
eff3(&a,&b);
bally1main();
}
}
main();
}
if (ch=='d'|| ch=='D')
{
setcolor(BLACK);
arrow(ii);
if(ii==250&&q==160)
{
q=0;w=0;ii=100;
}
if (ii==250)
{ii=100;q=0;w=10;}
ii+=25;
setcolor(RED);
arrow(ii);
}
if (ch=='a'|| ch=='A')
{
setcolor(BLACK);
arrow(ii);
if(ii==125&&q==160)
{
ii=275;
}
if (ii==125)
{ii=275;q=0;w=10;}
setcolor(RED);
ii-=25;
arrow(ii);
}
}
void border()
{
settextstyle(0,0,0);
setfillstyle(1,BLACK);
rectangle(1,1,600,300);
rectangle(9,9,591,291);
line(350,9,350,291);
line(360,9,360,291);
setcolor(BROWN);
outtextxy(390,55,"TO MOVE ARROW USE");
outtextxy(390,75,"'A' TO MOVE UP AND ");
outtextxy(390,95,"'D' TO MOVE DOWN. ");
outtextxy(390,115,"ENTER TAKES YOU TO ");
outtextxy(390,135,"THE MENU TO WHICH THE");
outtextxy(390,155,"PIONTER IS POINTING.");
outtextxy(390,175,"Q HELPS IN EXITING");
outtextxy(390,195,"ANY TIME.");
setfillstyle(HATCH_FILL,YELLOW);
floodfill(7,7,GREEN);
floodfill(355,15,GREEN);
rectangle(1,330,600,470);
setcolor(RED);
settextstyle(0,0,1);
outtextxy(30,40,"THE SHARK");
setcolor(GREEN);
setcolor(RED);
outtextxy(150,335,"Welcome... Hope U Enjoy using our Package...");
outtextxy(175,355,"For more information mail us at ");
outtextxy(175,375,"[email protected]");
outtextxy(175,385,"[email protected]");
outtextxy(175,395,"[email protected]");
outtextxy(175,405,"[email protected]");
outtextxy(175,455,"(:Thank you:)");
setcolor(GREEN);
outtextxy(350,455," :-The Sharks Associates-:");
setcolor(GREEN);
}
| [
"[email protected]"
] | [
[
[
1,
266
]
]
] |
266f999dd6acaf98d12503e9d8c4bec5ab330364 | c5ecda551cefa7aaa54b787850b55a2d8fd12387 | /src/UILayer/SharedFilesWnd.h | 19ec8d8687fddd4bb5995c83c50549a06d5750da | [] | no_license | firespeed79/easymule | b2520bfc44977c4e0643064bbc7211c0ce30cf66 | 3f890fa7ed2526c782cfcfabb5aac08c1e70e033 | refs/heads/master | 2021-05-28T20:52:15.983758 | 2007-12-05T09:41:56 | 2007-12-05T09:41:56 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,324 | h | //this file is part of eMule
//Copyright (C)2002-2005 Merkur ( [email protected] / http://www.emule-project.net )
//
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either
//version 2 of the License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#pragma once
#include "SharedFilesCtrl.h"
#include "ProgressCtrlX.h"
#include "IconStatic.h"
#include "SharedDirsTreeCtrl.h"
#include "SplitterControl.h"
#include "SplitterControlEx.h"
#include "TabWnd_Cake.h"
#include "UILayer/DetailInfo.h"
#include "UILayer/StatisticsInfo.h"
#include "UILayer/UpLoading.h"
#include "UILayer/UserComment.h"
#include "TbcShare.h"
#include "sharefilescountstatic.h"
#include "ResizableLib\ResizableDialog.h"
#include "SplitterControlEx.h"
class CSharedFilesWnd : public CResizableDialog
{
DECLARE_DYNAMIC(CSharedFilesWnd)
public:
CSharedFilesWnd(CWnd* pParent = NULL); // standard constructor
virtual ~CSharedFilesWnd();
void Localize();
void ShowSelectedFilesSummary();
void Reload();
// Dialog Data
enum { IDD = IDD_FILES };
CSharedFilesCtrl sharedfilesctrl;
CUpLoading m_UpLoading;
private:
CFont bold;
CSharedDirsTreeCtrl m_ctlSharedDirTree;
HICON icon_files;
CSplitterControlEx m_wndVSplitter;
CSplitterControlEx m_wndHSplitter;
CTabWnd_Cake m_tabWnd;
enum ETabId{TI_DETAIL, TI_REMARK, TI_STAT, TI_UPLOADING, TI_MAX};
POSITION m_tabIds[TI_MAX];
CDetailInfo m_DetailInfo;
CStatisticsInfo m_StatisticsInfo;
CUserComment m_UserComment;
UINT m_WndHSpliterPos;
UINT m_WndVSpliterPos;
protected:
void CreateSplitter();
void CreateTabWnd();
void InitCtrlsSize();
void SetAllIcons();
void DoVResize(int delta);
void DoHResize(int delta);
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnInitDialog();
virtual BOOL PreTranslateMessage(MSG* pMsg);
virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
afx_msg void OnBnClickedReloadsharedfiles();
afx_msg void OnLvnItemActivateSflist(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnNMClickSflist(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnSysColorChange();
afx_msg void OnStnDblclickFilesIco();
afx_msg void OnTvnSelchangedShareddirstree(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnSplitterMoved(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnHSplitterClicked(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnVSplitterClicked(NMHDR* pNMHDR, LRESULT* pResult);
public:
void ShowAllUploadingUsers( );
LRESULT OnListSelFileChanged(WPARAM wParam, LPARAM lParam);
protected:
void UpdateSplitterRange(void);
void ShowList(int nflag);
void ShowTree(int nflag);
};
| [
"LanceFong@4a627187-453b-0410-a94d-992500ef832d"
] | [
[
[
1,
104
]
]
] |
25562ceec3731a389f509a169512617871f7cd33 | 7ccf42cf95c94b3d18766451d5641c55cb37bc30 | /src/renderer.h | 6d3bfb36652fce6ea705f7be605fab7636f60539 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | yoshin4444/bjne | 4b8846e69bb4b6735091296489183996fa80a844 | d00e1e401a31e3f716453b267e531199071f63d6 | refs/heads/master | 2021-01-22T19:54:34.318633 | 2010-03-14T23:20:53 | 2010-03-14T23:20:53 | null | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 1,040 | h | //--------------------------------
// 外界とのインターフェース
#ifndef _RENDERER_H
#define _RENDERER_H
#include <string>
using namespace std;
struct screen_info{
void *buf;
int width,height,pitch,bpp;
};
struct sound_info{
void *buf;
int freq,bps,ch,sample;
};
struct input_info{
int *buf;
};
// 使い方
// まず request_xxx を呼び出す。必要なデータが返ってくるので
// バッファを埋めた後、output_xxx を呼び出す。
// request の返り値がNULLだった場合は出力する必要がない。
// input は output する必要が無い。
class renderer{
public:
virtual ~renderer(){}
virtual screen_info *request_screen(int width,int height)=0;
virtual sound_info *request_sound()=0;
virtual input_info *request_input(int pad_count,int button_count)=0;
virtual void output_screen(screen_info *info)=0;
virtual void output_sound(sound_info *info)=0;
virtual void output_message(const string &str)=0;
};
#endif
| [
"[email protected]"
] | [
[
[
1,
44
]
]
] |
24e314fa364835352755126a67e4b20570bf4d57 | 021e8c48a44a56571c07dd9830d8bf86d68507cb | /build/vtk/vtkRInterface.h | d612a901be37dee9fb0dce96255b4599386ad14f | [
"BSD-3-Clause"
] | permissive | Electrofire/QdevelopVset | c67ae1b30b0115d5c2045e3ca82199394081b733 | f88344d0d89beeec46f5dc72c20c0fdd9ef4c0b5 | refs/heads/master | 2021-01-18T10:44:01.451029 | 2011-05-01T23:52:15 | 2011-05-01T23:52:15 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,463 | h |
/*=========================================================================
Program: Visualization Toolkit
Module: vtkRInterface.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*-------------------------------------------------------------------------
Copyright 2009 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------*/
// .NAME vtkRInterface
//
// .SECTION Description
//
// This class defines a VTK interface to an embedded GNU R intepreter instance. An
// instance of the R interpreter is created when this class is instantiated. Additional
// instances of this class will share access the same R interpreter. The R interpreter will
// be shutdown when the application using this class exits.
//
// .SECTION See Also
// vtkRadapter vtkRcalculatorFilter
//
// .SECTION Thanks
// Developed by Thomas Otahal at Sandia National Laboratories.
//
#ifndef __vtkRInterface_h
#define __vtkRInterface_h
#include "vtkObject.h"
class vtkDataArray;
class vtkArray;
class vtkTable;
class vtkImplementationRSingleton;
class vtkRAdapter;
class VTK_GRAPHICS_EXPORT vtkRInterface : public vtkObject
{
public:
static vtkRInterface* New();
vtkTypeMacro(vtkRInterface,vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Evaluate an R command on the embedded R interpreter that takes one integer argument.
int EvalRcommand(const char *commandName, int param);
// Description:
// Evaluate an R script given in string on the embedded R interpreter. Set showRoutput
// to turn on and off output from R.
int EvalRscript(const char *string, bool showRoutput = true);
// Description:
// Provide a character buffer in p of length n. All output from the R interpreter instance
// will be written to p by default.
int OutputBuffer(char* p, int n);
// Description:
// Copies vtkDataArray da into the R interpreter instance as a variable named RVariableName.
// If RVariableName already exists, it will be overwritten.
void AssignVTKDataArrayToRVariable(vtkDataArray* da, const char* RVariableName);
// Description:
// Copies vtkArray da into the R interpreter instance as a variable named RVariableName.
// If RVariableName already exists, it will be overwritten.
void AssignVTKArrayToRVariable(vtkArray* da, const char* RVariableName);
// Description:
// Copies the R variable RVariableName to the returned vtkDataArray. If the operation fails,
// the method will return NULL.
vtkDataArray* AssignRVariableToVTKDataArray(const char* RVariableName);
// Description:
// Copies the R variable RVariableName to the returned vtkArray. If the operation fails,
// the method will return NULL. The returned vtkArray is currently always a vtkDenseArray
// of type double.
vtkArray* AssignRVariableToVTKArray(const char* RVariableName);
// Description:
// Copies the R matrix or R list in RVariableName to the returned vtkTable. If the operation fails,
// the method will return NULL. If RVariableName is an R list, each list entry must be a vector of
// the same length.
vtkTable* AssignRVariableToVTKTable(const char* RVariableName);
// Description:
// Copies the vtkTable given in table to an R list structure name RVariableName. The R list
// will be length of the number of columns in table. Each member of the list will contain a
// column of table.
void AssignVTKTableToRVariable(vtkTable* table, const char* RVariableName);
protected:
vtkRInterface();
~vtkRInterface();
private:
int FillOutputBuffer();
vtkRInterface(const vtkRInterface&); // Not implemented
void operator=(const vtkRInterface&); // Not implemented
vtkImplementationRSingleton* rs;
char* buffer;
int buffer_size;
vtkRAdapter* vra;
};
#endif
| [
"ganondorf@ganondorf-VirtualBox.(none)"
] | [
[
[
1,
123
]
]
] |
2e440f49fb9cb7d52d6f2b1e0705bb50644b74eb | b14d5833a79518a40d302e5eb40ed5da193cf1b2 | /cpp/extern/xercesc++/2.6.0/src/xercesc/dom/deprecated/EntityImpl.cpp | 1fcdfcb645a7b865b2b4658f705aa7e59768b491 | [
"Apache-2.0"
] | permissive | andyburke/bitflood | dcb3fb62dad7fa5e20cf9f1d58aaa94be30e82bf | fca6c0b635d07da4e6c7fbfa032921c827a981d6 | refs/heads/master | 2016-09-10T02:14:35.564530 | 2011-11-17T09:51:49 | 2011-11-17T09:51:49 | 2,794,411 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,484 | cpp | /*
* Copyright 1999-2002,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: EntityImpl.cpp,v 1.5 2004/09/08 13:55:43 peiyongz Exp $
*/
#include "DOM_DOMException.hpp"
#include "DOM_Node.hpp"
#include "EntityImpl.hpp"
#include "DocumentImpl.hpp"
XERCES_CPP_NAMESPACE_BEGIN
EntityImpl::EntityImpl(DocumentImpl *ownerDoc, const DOMString &eName)
: ParentNode(ownerDoc),
refEntity(0)
{
name = eName.clone();
setReadOnly(true, true);
};
EntityImpl::EntityImpl(const EntityImpl &other, bool deep)
: ParentNode(other)
{
name = other.name.clone();
if (deep)
cloneChildren(other);
publicId = other.publicId.clone();
systemId = other.systemId.clone();
notationName = other.notationName.clone();
RefCountedImpl::removeRef(refEntity);
refEntity = other.refEntity;
RefCountedImpl::addRef(other.refEntity);
setReadOnly(true, true);
};
EntityImpl::~EntityImpl() {
};
NodeImpl *EntityImpl::cloneNode(bool deep)
{
return new (getOwnerDocument()->getMemoryManager()) EntityImpl(*this, deep);
};
DOMString EntityImpl::getNodeName() {
return name;
};
short EntityImpl::getNodeType() {
return DOM_Node::ENTITY_NODE;
};
DOMString EntityImpl::getNotationName()
{
return notationName;
};
DOMString EntityImpl::getPublicId() {
return publicId;
};
DOMString EntityImpl::getSystemId()
{
return systemId;
};
void EntityImpl::setNotationName(const DOMString &arg)
{
notationName = arg;
};
void EntityImpl::setPublicId(const DOMString &arg)
{
publicId = arg;
};
void EntityImpl::setSystemId(const DOMString &arg)
{
systemId = arg;
};
void EntityImpl::setEntityRef(EntityReferenceImpl* other)
{
RefCountedImpl::removeRef(refEntity);
refEntity = other;
RefCountedImpl::addRef(other);
}
EntityReferenceImpl* EntityImpl::getEntityRef() const
{
return refEntity;
}
void EntityImpl::cloneEntityRefTree()
{
//lazily clone the entityRef tree to this entity
if (firstChild != 0)
return;
if (!refEntity)
return;
setReadOnly(false, true);
this->cloneChildren(*refEntity);
setReadOnly(true, true);
}
NodeImpl * EntityImpl::getFirstChild()
{
cloneEntityRefTree();
return firstChild;
};
NodeImpl* EntityImpl::getLastChild()
{
cloneEntityRefTree();
return lastChild();
}
NodeListImpl* EntityImpl::getChildNodes()
{
cloneEntityRefTree();
return this;
}
bool EntityImpl::hasChildNodes()
{
cloneEntityRefTree();
return firstChild!=null;
}
NodeImpl* EntityImpl::item(unsigned int index)
{
cloneEntityRefTree();
ChildNode *node = firstChild;
for(unsigned int i=0; i<index && node!=null; ++i)
node = node->nextSibling;
return node;
}
XERCES_CPP_NAMESPACE_END
| [
"[email protected]"
] | [
[
[
1,
172
]
]
] |
44f508b9acc1c39f0fa3b2da76bf091d88ac5224 | 2982a765bb21c5396587c86ecef8ca5eb100811f | /util/wm5/LibCore/ObjectSystems/Wm5InitTerm.cpp | 1dab8b31db7fb46485d90e66b413a0585a5c2e42 | [] | no_license | evanw/cs224final | 1a68c6be4cf66a82c991c145bcf140d96af847aa | af2af32732535f2f58bf49ecb4615c80f141ea5b | refs/heads/master | 2023-05-30T19:48:26.968407 | 2011-05-10T16:21:37 | 2011-05-10T16:21:37 | 1,653,696 | 27 | 9 | null | null | null | null | UTF-8 | C++ | false | false | 1,780 | cpp | // Geometric Tools, LLC
// Copyright (c) 1998-2010
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
//
// File Version: 5.0.0 (2010/01/01)
#include "Wm5CorePCH.h"
#include "Wm5InitTerm.h"
#include "Wm5Assert.h"
using namespace Wm5;
int InitTerm::msNumInitializers = 0;
InitTerm::Initializer InitTerm::msInitializers[MAX_ELEMENTS];
int InitTerm::msNumTerminators = 0;
InitTerm::Terminator InitTerm::msTerminators[MAX_ELEMENTS];
//----------------------------------------------------------------------------
void InitTerm::AddInitializer (Initializer function)
{
if (msNumInitializers < MAX_ELEMENTS)
{
msInitializers[msNumInitializers++] = function;
}
else
{
assertion(false, "Increase MAX_ELEMENTS and recompile LibCore\n");
}
}
//----------------------------------------------------------------------------
void InitTerm::ExecuteInitializers ()
{
for (int i = 0; i < msNumInitializers; ++i)
{
msInitializers[i]();
}
}
//----------------------------------------------------------------------------
void InitTerm::AddTerminator (Terminator function)
{
if (msNumTerminators < MAX_ELEMENTS)
{
msTerminators[msNumTerminators++] = function;
}
else
{
assertion(false, "Increase MAX_ELEMENTS and recompile LibCore\n");
}
}
//----------------------------------------------------------------------------
void InitTerm::ExecuteTerminators ()
{
for (int i = 0; i < msNumTerminators; ++i)
{
msTerminators[i]();
}
}
//----------------------------------------------------------------------------
| [
"[email protected]"
] | [
[
[
1,
59
]
]
] |
77042319f213657af271a2ae84465b9accc198f5 | 92be0bd8bb55b9ecf67d9313eda7a633502c2774 | /StrangeWorld_Windows/StrangeWindowsView.h | 804da7eab9c216a5558cb616d42ddf531463825f | [] | no_license | fredlebel/StrangeWorld4 | 4b58ab4d283a59528394dda610df882b037102ea | 080c5980ed34b0226875a5795db2096db7b739e5 | refs/heads/master | 2016-08-03T01:24:39.425510 | 2011-04-25T18:14:33 | 2011-04-25T18:14:33 | 1,580,337 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,172 | h | #ifndef _StrangeWindowsView_h_included_
#define _StrangeWindowsView_h_included_
#include <Windows.h>
#include "StrangeView.h"
#include "StrangeWorld.h"
//#define USE_GDIPLUS
#if defined( USE_GDIPLUS )
#include "gdiplus.h"
#endif
class StrangeWindowsView
: public StrangeView
{
public:
StrangeWindowsView( HWND hWnd, StrangeWorld* world );
virtual ~StrangeWindowsView();
void beginPaint( HDC dc );
void endPaint();
virtual int getWidth();
virtual int getHeight();
// Rendering calls
virtual void drawCarnivore( int x, int y, int tx, int ty, int r, int health, bool selected, bool dead );
virtual void drawHerbivore( int x, int y, int tx, int ty, int r, int health, bool selected, bool dead );
virtual void drawGrass( int x, int y, int r, int health, bool selected );
virtual void drawSensors( int x1, int y1, int x2, int y2, int r );
virtual void write( int x, int y, std::wstring const& str );
protected:
HWND hWnd_;
StrangeWorld* world_;
HDC dc_;
#if defined( USE_GDIPLUS )
Gdiplus::Graphics* graphics_;
#endif
};
#endif //_StrangeWindowsView_h_included_ | [
"[email protected]"
] | [
[
[
1,
42
]
]
] |
adac87cc94176e47e716c67b9d96aeb7a10f3143 | fe7a7f1385a7dd8104e6ccc105f9bb3141c63c68 | /creature.h | 6c2e77bf5a07c6519ab639a0471401a0e4ce1603 | [] | no_license | divinity76/ancient-divinity-ots | d29efe620cea3fe8d61ffd66480cf20c8f77af13 | 0c7b5bfd5b9277c97d28de598f781dbb198f473d | refs/heads/master | 2020-05-16T21:01:29.130756 | 2010-10-11T22:58:07 | 2010-10-11T22:58:07 | 29,501,722 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,530 | h | //////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
//////////////////////////////////////////////////////////////////////
// base class for every creature
//////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//////////////////////////////////////////////////////////////////////
#ifndef __OTSERV_CREATURE_H__
#define __OTSERV_CREATURE_H__
#include "definitions.h"
#include "templates.h"
#include "map.h"
#include "position.h"
#include "condition.h"
#include "const76.h"
#include "tile.h"
#include "enums.h"
#include "creatureevent.h"
#define EVENT_CREATURE_INTERVAL 500
#include <list>
typedef std::list<Condition*> ConditionList;
enum slots_t {
SLOT_WHEREEVER = 0,
SLOT_FIRST = 1,
SLOT_HEAD = SLOT_FIRST,
SLOT_NECKLACE = 2,
SLOT_BACKPACK = 3,
SLOT_ARMOR = 4,
SLOT_RIGHT = 5,
SLOT_LEFT = 6,
SLOT_LEGS = 7,
SLOT_FEET = 8,
SLOT_RING = 9,
SLOT_AMMO = 10,
SLOT_DEPOT = 11,
SLOT_LAST = SLOT_DEPOT
};
struct FindPathParams{
bool fullPathSearch;
bool clearSight;
bool allowDiagonal;
bool keepDistance;
int32_t maxSearchDist;
int32_t minTargetDist;
int32_t maxTargetDist;
FindPathParams()
{
clearSight = true;
fullPathSearch = true;
allowDiagonal = true;
keepDistance = false;
maxSearchDist = -1;
minTargetDist = -1;
maxTargetDist = -1;
}
};
enum ZoneType_t{
ZONE_PROTECTION,
ZONE_NOPVP,
ZONE_PVP,
ZONE_NOLOGOUT,
ZONE_NORMAL
};
class Map;
class Thing;
class Container;
class Player;
class Monster;
class Npc;
class Item;
class Tile;
#define EVENT_CREATURECOUNT 10
#define EVENT_CREATURE_THINK_INTERVAL 1000
#define EVENT_CHECK_CREATURE_INTERVAL (EVENT_CREATURE_THINK_INTERVAL / EVENT_CREATURECOUNT)
class FrozenPathingConditionCall {
public:
FrozenPathingConditionCall(const Position& _targetPos);
virtual ~FrozenPathingConditionCall() {}
virtual bool operator()(const Position& startPos, const Position& testPos,
const FindPathParams& fpp, int32_t& bestMatchDist) const;
bool isInRange(const Position& startPos, const Position& testPos,
const FindPathParams& fpp) const;
protected:
Position targetPos;
};
//////////////////////////////////////////////////////////////////////
// Defines the Base class for all creatures and base functions which
// every creature has
class Creature : public AutoID, virtual public Thing
{
protected:
Creature();
public:
virtual ~Creature();
virtual Creature* getCreature() {return this;};
virtual const Creature* getCreature()const {return this;};
virtual Player* getPlayer() {return NULL;};
virtual const Player* getPlayer() const {return NULL;};
virtual Npc* getNpc() {return NULL;};
virtual const Npc* getNpc() const {return NULL;};
virtual Monster* getMonster() {return NULL;};
virtual const Monster* getMonster() const {return NULL;};
#ifdef __PB_GMINVISIBLE__
virtual bool isGmInvis() const {return false;}
#endif
bool isDying;
void getPathToFollowCreature();
virtual const std::string& getName() const = 0;
virtual const std::string& getNameDescription() const = 0;
virtual std::string getDescription(int32_t lookDistance) const;
void setID(){this->id = auto_id | this->idRange();}
void setRemoved() {isInternalRemoved = true;}
virtual uint32_t idRange() = 0;
uint32_t getID() const { return id; }
virtual void removeList() = 0;
virtual void addList() = 0;
virtual bool canSee(const Position& pos) const;
virtual bool canSeeCreature(const Creature* creature) const;
virtual RaceType_t getRace() const {return RACE_NONE;}
Direction getDirection() const { return direction;}
void setDirection(Direction dir) { direction = dir;}
const Position& getMasterPos() const { return masterPos;}
void setMasterPos(const Position& pos, uint32_t radius = 1) { masterPos = pos; masterRadius = radius;}
virtual int getThrowRange() const {return 1;};
virtual bool isPushable() const {return (getSleepTicks() <= 0);};
virtual bool isRemoved() const {return isInternalRemoved;};
virtual bool canSeeInvisibility() const { return false;}
int64_t getSleepTicks() const;
int32_t getWalkDelay(Direction dir) const;
int64_t getTimeSinceLastMove() const;
virtual int64_t getEventStepTicks() const;
int32_t getStepDuration() const;
virtual int32_t getStepSpeed() const {return getSpeed();}
int32_t getSpeed() const {return baseSpeed + varSpeed;}
void setSpeed(int32_t varSpeedDelta)
{
int32_t oldSpeed = getSpeed();
varSpeed = varSpeedDelta;
if(getSpeed() <= 0){
stopEventWalk();
}
else if(oldSpeed <= 0 && !listWalkDir.empty()){
addEventWalk();
}
}
void setBaseSpeed(uint32_t newBaseSpeed) {baseSpeed = newBaseSpeed;}
int getBaseSpeed() {return baseSpeed;}
virtual int32_t getHealth() const {return health;}
virtual int32_t getMaxHealth() const {return healthMax;}
virtual int32_t getMana() const {return mana;}
virtual int32_t getMaxMana() const {return manaMax;}
const Outfit_t getCurrentOutfit() const {return currentOutfit;}
const void setCurrentOutfit(Outfit_t outfit) {currentOutfit = outfit;}
const Outfit_t getDefaultOutfit() const {return defaultOutfit;}
bool isInvisible() const {return hasCondition(CONDITION_INVISIBLE);}
ZoneType_t getZone() const {
const Tile* tile = getTile();
if(tile->hasFlag(TILESTATE_PROTECTIONZONE)){
return ZONE_PROTECTION;
}
else if(tile->hasFlag(TILESTATE_NOPVPZONE)){
return ZONE_NOPVP;
}
else if(tile->hasFlag(TILESTATE_PVPZONE)){
return ZONE_PVP;
}
else{
return ZONE_NORMAL;
}
}
//walk functions
bool startAutoWalk(std::list<Direction>& listDir);
void addEventWalk();
void stopEventWalk();
//walk events
virtual void onWalk(Direction& dir);
virtual void onWalkAborted() {};
virtual void onWalkComplete() {};
//follow functions
virtual Creature* getFollowCreature() const { return followCreature; };
virtual bool setFollowCreature(Creature* creature, bool fullPathSearch = false);
//follow events
virtual void onFollowCreature(const Creature* creature) {};
virtual void onFollowCreatureComplete(const Creature* creature) {};
//combat functions
Creature* getAttackedCreature() { return attackedCreature; }
virtual bool setAttackedCreature(Creature* creature);
virtual BlockType_t blockHit(Creature* attacker, CombatType_t combatType, int32_t& damage,
bool checkDefense = false, bool checkArmor = false);
void setMaster(Creature* creature) {master = creature;}
Creature* getMaster() {return master;}
bool isSummon() const {return master != NULL;}
const Creature* getMaster() const {return master;}
virtual void addSummon(Creature* creature);
virtual void removeSummon(const Creature* creature);
const std::list<Creature*>& getSummons() {return summons;}
virtual int32_t getArmor() const {return 0;}
virtual int32_t getDefense() const {return 0;}
virtual float getAttackFactor() const {return 1.0f;}
virtual float getDefenseFactor() const {return 1.0f;}
bool addCondition(Condition* condition);
bool addCombatCondition(Condition* condition);
void removeCondition(ConditionType_t type, ConditionId_t id);
void removeCondition(ConditionType_t type);
void removeCondition(Condition* condition);
void removeCondition(const Creature* attacker, ConditionType_t type);
Condition* getCondition(ConditionType_t type, ConditionId_t id) const;
Condition* getCondition(ConditionType_t type) const;
void executeConditions(uint32_t interval);
bool hasCondition(ConditionType_t type) const;
virtual bool isImmune(ConditionType_t type) const;
virtual bool isImmune(CombatType_t type) const;
virtual bool isSuppress(ConditionType_t type) const;
virtual uint32_t getDamageImmunities() const { return 0; }
virtual uint32_t getConditionImmunities() const { return 0; }
virtual uint32_t getConditionSuppressions() const { return 0; }
virtual bool isAttackable() const { return true;}
bool isIdle() const { return checkCreatureVectorIndex == 0;}
virtual void changeHealth(int32_t healthChange);
virtual void changeMana(int32_t manaChange);
virtual void gainHealth(Creature* caster, int32_t healthGain);
virtual void drainHealth(Creature* attacker, CombatType_t combatType, int32_t damage);
virtual void drainMana(Creature* attacker, int32_t manaLoss);
virtual bool challengeCreature(Creature* creature) {return false;};
virtual bool convinceCreature(Creature* creature) {return false;};
virtual void onDie();
virtual uint64_t getGainedExperience(Creature* attacker, bool useMultiplier = true) const;
void addDamagePoints(Creature* attacker, int32_t damagePoints);
void addHealPoints(Creature* caster, int32_t healthPoints);
bool hasBeenAttacked(uint32_t attackerId);
//combat event functions
virtual void onAddCondition(ConditionType_t type);
virtual void onAddCombatCondition(ConditionType_t type);
virtual void onEndCondition(ConditionType_t type);
virtual void onTickCondition(ConditionType_t type, bool& bRemove);
virtual void onCombatRemoveCondition(const Creature* attacker, Condition* condition);
virtual void onAttackedCreature(Creature* target);
virtual void onAttacked();
virtual void onAttackedCreatureDrainHealth(Creature* target, int32_t points);
virtual void onTargetCreatureGainHealth(Creature* target, int32_t points);
virtual void onAttackedCreatureKilled(Creature* target);
virtual void onKilledCreature(Creature* target);
virtual void onGainExperience(uint64_t gainExp);
virtual void onAttackedCreatureBlockHit(Creature* target, BlockType_t blockType);
virtual void onBlockHit(BlockType_t blockType);
virtual void onChangeZone(ZoneType_t zone);
virtual void onAttackedCreatureChangeZone(ZoneType_t zone);
virtual void onIdleStatus();
virtual void getCreatureLight(LightInfo& light) const;
virtual void setNormalCreatureLight();
void setCreatureLight(LightInfo& light) {internalLight = light;}
virtual void onThink(uint32_t interval);
virtual void onAttacking(uint32_t interval);
virtual void onWalk();
virtual bool getNextStep(Direction& dir);
virtual void onAddTileItem(const Tile* tile, const Position& pos, const Item* item);
virtual void onUpdateTileItem(const Tile* tile, const Position& pos, uint32_t stackpos,
const Item* oldItem, const ItemType& oldType, const Item* newItem, const ItemType& newType);
virtual void onRemoveTileItem(const Tile* tile, const Position& pos, uint32_t stackpos,
const ItemType& iType, const Item* item);
virtual void onUpdateTile(const Tile* tile, const Position& pos);
virtual void onCreatureAppear(const Creature* creature, bool isLogin);
virtual void onCreatureDisappear(const Creature* creature, uint32_t stackpos, bool isLogout);
virtual void onCreatureMove(const Creature* creature, const Tile* newTile, const Position& newPos,
const Tile* oldTile, const Position& oldPos, uint32_t oldStackPos, bool teleport);
virtual void onAttackedCreatureDissapear(bool isLogout) {};
virtual void onFollowCreatureDissapear(bool isLogout) {};
virtual void onCreatureTurn(const Creature* creature, uint32_t stackPos) { };
virtual void onCreatureSay(const Creature* creature, SpeakClasses type, const std::string& text) { };
virtual void onCreatureChangeOutfit(const Creature* creature, const Outfit_t& outfit) { };
virtual void onCreatureConvinced(const Creature* convincer, const Creature* creature) {};
virtual void onCreatureChangeVisible(const Creature* creature, bool visible);
virtual void onPlacedCreature() {};
virtual void onRemovedCreature() {};
virtual WeaponType_t getWeaponType() {return WEAPON_NONE;}
virtual bool getCombatValues(int32_t& min, int32_t& max) {return false;}
uint32_t getSummonCount() const {return summons.size();}
void setDropLoot(bool _lootDrop) {lootDrop = _lootDrop;}
void setLossSkill(bool _skillLoss) {skillLoss = _skillLoss;}
//creature script events
bool registerCreatureEvent(const std::string& name);
virtual void setParent(Cylinder* cylinder){
_tile = dynamic_cast<Tile*>(cylinder);
Thing::setParent(cylinder);
}
virtual const Position& getPosition() const {return _tile->getTilePosition();}
virtual Tile* getTile(){return _tile;}
virtual const Tile* getTile() const{return _tile;}
int32_t getWalkCache(const Position& pos) const;
static bool canSee(const Position& myPos, const Position& pos, uint32_t viewRangeX, uint32_t viewRangeY);
void death(std::string killer, std::string altKiller);
protected:
static const int32_t mapWalkWidth = Map::maxViewportX * 2 + 1;
static const int32_t mapWalkHeight = Map::maxViewportY * 2 + 1;
bool localMapCache[mapWalkHeight][mapWalkWidth];
virtual bool useCacheMap() const {return false;}
Tile* _tile;
uint32_t id;
bool isInternalRemoved;
bool isMapLoaded;
bool isUpdatingPath;
// The creature onThink event vector this creature belongs to
// The value stored here is actually 1 larger than the index,
// this is to allow 0 to represent the special value of not
// being stored in any onThink vector
size_t checkCreatureVectorIndex;
int32_t health, healthMax;
int32_t mana, manaMax;
Outfit_t currentOutfit;
Outfit_t defaultOutfit;
Position masterPos;
int32_t masterRadius;
uint64_t lastStep;
uint32_t lastStepCost;
uint32_t extraStepDuration;
uint32_t baseSpeed;
int32_t varSpeed;
bool skillLoss;
bool lootDrop;
Direction direction;
ConditionList conditions;
LightInfo internalLight;
//summon variables
Creature* master;
std::list<Creature*> summons;
//follow variables
Creature* followCreature;
uint32_t eventWalk;
std::list<Direction> listWalkDir;
uint32_t walkUpdateTicks;
bool hasFollowPath;
bool forceUpdateFollowPath;
//combat variables
Creature* attackedCreature;
struct CountBlock_t{
int32_t total;
int64_t ticks;
};
typedef std::map<uint32_t, CountBlock_t> CountMap;
CountMap damageMap;
CountMap healMap;
uint32_t lastHitCreature;
uint32_t blockCount;
uint32_t blockTicks;
//creature script events
uint32_t scriptEventsBitField;
bool hasEventRegistered(CreatureEventType_t event){
return (0 != (scriptEventsBitField & ((uint32_t)1 << event)));
}
typedef std::list<CreatureEvent*> CreatureEventList;
CreatureEventList eventsList;
CreatureEventList::iterator findEvent(CreatureEventType_t type);
CreatureEvent* getCreatureEvent(CreatureEventType_t type);
void updateMapCache();
#ifdef __DEBUG__
void validateMapCache();
#endif
void updateTileCache(const Tile* tile, int32_t dx, int32_t dy);
void updateTileCache(const Tile* tile, const Position& pos);
void onCreatureDisappear(const Creature* creature, bool isLogout);
virtual void doAttacking(uint32_t interval) {};
virtual bool hasExtraSwing() {return false;}
virtual uint64_t getLostExperience() const { return 0; };
virtual double getDamageRatio(Creature* attacker) const;
bool getKillers(Creature** lastHitCreature, Creature** mostDamageCreature);
virtual void dropLoot(Container* corpse) {};
virtual uint16_t getLookCorpse() const { return 0; }
virtual void getPathSearchParams(const Creature* creature, FindPathParams& fpp) const;
virtual void die() {};
virtual void dropCorpse();
virtual Item* getCorpse();
friend class Game;
friend class Map;
friend class Commands;
friend class LuaScriptInterface;
};
#endif
| [
"[email protected]@6be3b30e-f956-11de-ba51-6b4196a2b81e"
] | [
[
[
1,
471
]
]
] |
89ca47983874ce4a1cd0a3772428256e0d2931b0 | e7c45d18fa1e4285e5227e5984e07c47f8867d1d | /Common/Models/SIZEDST1/SqSzDMeasPPg.cpp | 7c4f42badc715cf75ebe4aa2928ea55dbacfc728 | [] | no_license | abcweizhuo/Test3 | 0f3379e528a543c0d43aad09489b2444a2e0f86d | 128a4edcf9a93d36a45e5585b70dee75e4502db4 | refs/heads/master | 2021-01-17T01:59:39.357645 | 2008-08-20T00:00:29 | 2008-08-20T00:00:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,209 | cpp | // SqSzDMeasPPg.cpp : implementation file
//
#include "stdafx.h"
#include "SizeDst1.h"
#include "SqSzDMeasPPg.h"
// CSqSzDMeasPPg dialog
IMPLEMENT_DYNCREATE(CSqSzDMeasPPg, CDHtmlDialog)
CSqSzDMeasPPg::CSqSzDMeasPPg(CWnd* pParent /*=NULL*/)
: CDHtmlDialog(CSqSzDMeasPPg::IDD, CSqSzDMeasPPg::IDH, pParent)
{
}
CSqSzDMeasPPg::~CSqSzDMeasPPg()
{
}
void CSqSzDMeasPPg::DoDataExchange(CDataExchange* pDX)
{
CDHtmlDialog::DoDataExchange(pDX);
}
BOOL CSqSzDMeasPPg::OnInitDialog()
{
CDHtmlDialog::OnInitDialog();
return TRUE; // return TRUE unless you set the focus to a control
}
BEGIN_MESSAGE_MAP(CSqSzDMeasPPg, CDHtmlDialog)
END_MESSAGE_MAP()
BEGIN_DHTML_EVENT_MAP(CSqSzDMeasPPg)
DHTML_EVENT_ONCLICK(_T("ButtonOK"), OnButtonOK)
DHTML_EVENT_ONCLICK(_T("ButtonCancel"), OnButtonCancel)
END_DHTML_EVENT_MAP()
// CSqSzDMeasPPg message handlers
HRESULT CSqSzDMeasPPg::OnButtonOK(IHTMLElement* /*pElement*/)
{
OnOK();
return S_OK; // return TRUE unless you set the focus to a control
}
HRESULT CSqSzDMeasPPg::OnButtonCancel(IHTMLElement* /*pElement*/)
{
OnCancel();
return S_OK; // return TRUE unless you set the focus to a control
}
| [
"[email protected]"
] | [
[
[
1,
55
]
]
] |
5ffea04b028f44fce30e5600c81dd22295cbaf3a | fcf03ead74f6dc103ec3b07ffe3bce81c820660d | /Graphics/WS/Simple/Simple.cpp | db43917c3f6c807b63d737df1b34ddb7b7c4b5a8 | [] | no_license | huellif/symbian-example | 72097c9aec6d45d555a79a30d576dddc04a65a16 | 56f6c5e67a3d37961408fc51188d46d49bddcfdc | refs/heads/master | 2016-09-06T12:49:32.021854 | 2010-10-14T06:31:20 | 2010-10-14T06:31:20 | 38,062,421 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,387 | cpp | // Simple.CPP
//
// Copyright (c) 2005 Symbian Softwares Ltd. All rights reserved.
//
#include <w32std.h>
#include "Base.h"
#include "Simple.h"
//////////////////////////////////////////////////////////////////////////////
// Implementation for derived window classes
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// CMainWindow implementation //
//////////////////////////////////////////////////////////////////////////////
/****************************************************************************\
| Function: Constructor/Destructor for CMainWindow
| Doesn't do much, as most initialisation is done by the
| CWindow base class.
| Input: aClient Client application that owns the window
\****************************************************************************/
CMainWindow::CMainWindow (CWsClient* aClient)
: CWindow (aClient)
{
}
CMainWindow::~CMainWindow ()
{
}
/****************************************************************************\
| Function: CMainWindow::Draw
| Purpose: Redraws the contents of CMainWindow within a given
| rectangle. As CMainWindow has no contents, it simply
| clears the redraw area. A blank window could be used here
| instead. The Clear() is needed because a redraw should
| always draw to every pixel in the redraw rectangle.
| Input: aRect Rectangle that needs redrawing
| Output: None
\****************************************************************************/
void CMainWindow::Draw(const TRect& aRect)
{
CWindowGc* gc=SystemGc(); // get a gc
gc->SetClippingRect(aRect); // clip outside this rect
gc->Clear(aRect); // clear
gc->SetBrushColor(KRgbBlue);
gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
gc->DrawRect(aRect);
}
/****************************************************************************\
| Function: CMainWindow::HandlePointerEvent
| Purpose: Handles pointer events for CMainWindow. Doesn't do
| anything here.
| Input: aPointerEvent The pointer event
| Output: None
\****************************************************************************/
void CMainWindow::HandlePointerEvent (TPointerEvent& aPointerEvent)
{
TBuf<128> infoBuffer;
infoBuffer.Format(_L("CSmallWindow::HandlePointerEvent((%d, %d))"),
aPointerEvent.iPosition.iX, aPointerEvent.iPosition.iY);
User::InfoPrint(infoBuffer);
}
//////////////////////////////////////////////////////////////////////////////
// CSmallWindow implementation
//////////////////////////////////////////////////////////////////////////////
/****************************************************************************\
| Function: Constructor/Destructor for CSmallWindow
| Doesn't do much, as most initialisation is done by the
| CWindow base class.
| Input: aClient Client application that owns the window
\****************************************************************************/
CSmallWindow::CSmallWindow (CWsClient* aClient)
: CWindow (aClient)
{
}
CSmallWindow::~CSmallWindow ()
{
iWindow.Close();
}
/****************************************************************************\
| Function: CSmallWindow::Draw
| Purpose: Redraws the contents of CSmallWindow within a given
| rectangle. CSmallWindow displays a square border around
| the edges of the window, and two diagonal lines between the
| corners.
| Input: aRect Rectangle that needs redrawing
| Output: None
\****************************************************************************/
void CSmallWindow::Draw(const TRect& aRect)
{
// Drawing to a window is done using functions supplied by
// the graphics context (CWindowGC), not the window.
CWindowGc* gc=SystemGc(); // get a gc
gc->SetClippingRect(aRect); // clip outside this rect
gc->Clear(aRect); // clear
TSize size=iWindow.Size();
TInt width=size.iWidth;
TInt height=size.iHeight;
// Draw a square border
gc->DrawLine(TPoint(0,0),TPoint(0,height-1));
gc->DrawLine (TPoint (0, height-1), TPoint (width-1, height-1));
gc->DrawLine(TPoint(width-1,height-1),TPoint(width-1,0));
gc->DrawLine (TPoint (width-1, 0), TPoint (0, 0));
// Draw a line between the corners of the window
gc->DrawLine(TPoint(0,0),TPoint(width, height));
gc->DrawLine (TPoint (0, height), TPoint (width, 0));
}
/****************************************************************************\
| Function: CSmallWindow::HandlePointerEvent
| Purpose: Handles pointer events for CSmallWindow. Doesn't do
| anything here.
| Input: aPointerEvent The pointer event
| Output: None
\****************************************************************************/
void CSmallWindow::HandlePointerEvent (TPointerEvent& aPointerEvent)
{
TBuf<128> infoBuffer;
infoBuffer.Format(_L("CSmallWindow::HandlePointerEvent((%d, %d))"),
aPointerEvent.iPosition.iX, aPointerEvent.iPosition.iY);
User::InfoPrint(infoBuffer);
}
//////////////////////////////////////////////////////////////////////////////
// CExampleWsClient implementation //
//////////////////////////////////////////////////////////////////////////////
CExampleWsClient* CExampleWsClient::NewL(const TRect& aRect)
{
// make new client
CExampleWsClient* client=new (ELeave) CExampleWsClient(aRect);
CleanupStack::PushL(client); // push, just in case
client->ConstructL(); // construct and run
CleanupStack::Pop();
return client;
}
/****************************************************************************\
| Function: Constructor/Destructor for CExampleWsClient
| Destructor deletes everything that was allocated by
| ConstructMainWindowL()
\****************************************************************************/
CExampleWsClient::CExampleWsClient(const TRect& aRect)
:iRect(aRect)
{
}
CExampleWsClient::~CExampleWsClient ()
{
delete iMainWindow;
delete iSmallWindow;
}
/****************************************************************************\
| Function: CExampleWsClient::ConstructMainWindowL()
| Called by base class's ConstructL
| Purpose: Allocates and creates all the windows owned by this client
| (See list of windows in CExampleWsCLient declaration).
\****************************************************************************/
void CExampleWsClient::ConstructMainWindowL()
{
iMainWindow=new (ELeave) CMainWindow(this);
iMainWindow->ConstructL(iRect);
iSmallWindow = new (ELeave) CSmallWindow (this);
iSmallWindow->ConstructL (TRect (TPoint (300, 0), TSize (50, 50)), iMainWindow);
}
/****************************************************************************\
| Function: CExampleWsClient::RunL()
| Called by active scheduler when an even occurs
| Purpose: Processes events according to their type
| For key events: calls HandleKeyEventL() (global to client)
| For pointer event: calls HandlePointerEvent() for window
| event occurred in.
\****************************************************************************/
void CExampleWsClient::RunL()
{
TWsEvent wsEvent;
// get the event
iWs.GetEvent(wsEvent);
TInt eventType=wsEvent.Type();
// take action on it
switch (eventType)
{
// window-group related event types
case EEventNull:
break;
case EEventKey:
{
TKeyEvent& keyEvent=*wsEvent.Key(); // get key event
HandleKeyEventL (keyEvent);
break;
}
case EEventKeyUp:
case EEventKeyDown:
case EEventModifiersChanged:
case EEventFocusLost:
case EEventFocusGained:
case EEventSwitchOn:
case EEventPassword:
case EEventWindowGroupsChanged:
case EEventErrorMessage:
break;
// window related events
case EEventPointer:
{
CWindow* window=(CWindow*)(wsEvent.Handle()); // get window
TPointerEvent& pointerEvent=*wsEvent.Pointer();
window->HandlePointerEvent (pointerEvent);
break;
}
case EEventPointerEnter:
case EEventPointerExit:
case EEventPointerBufferReady:
case EEventDragDrop:
break;
default:
break;
}
IssueRequest(); // maintain outstanding request
}
void CExampleWsClient::HandleKeyEventL(struct TKeyEvent& /*aKeyEvent*/)
{
}
| [
"liuxk99@bdc341c6-17c0-11de-ac9f-1d9250355bca"
] | [
[
[
1,
248
]
]
] |
eac13a1a9a57e707480b2a36883be5c93bbb40bc | 5c4e36054f0752a610ad149dfd81e6f35ccb37a1 | /libs/src2.75/BulletSoftBody/btSoftRigidDynamicsWorld.cpp | 784e491a962d28ae48a1d554004c02adb6e6f4b4 | [] | no_license | Akira-Hayasaka/ofxBulletPhysics | 4141dc7b6dff7e46b85317b0fe7d2e1f8896b2e4 | 5e45da80bce2ed8b1f12de9a220e0c1eafeb7951 | refs/heads/master | 2016-09-15T23:11:01.354626 | 2011-09-22T04:11:35 | 2011-09-22T04:11:35 | 1,152,090 | 6 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,386 | cpp | /*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "btSoftRigidDynamicsWorld.h"
#include "LinearMath/btQuickprof.h"
//softbody & helpers
#include "btSoftBody.h"
#include "btSoftBodyHelpers.h"
btSoftRigidDynamicsWorld::btSoftRigidDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration)
:btDiscreteDynamicsWorld(dispatcher,pairCache,constraintSolver,collisionConfiguration)
{
m_drawFlags = fDrawFlags::Std;
m_drawNodeTree = true;
m_drawFaceTree = false;
m_drawClusterTree = false;
m_sbi.m_broadphase = pairCache;
m_sbi.m_dispatcher = dispatcher;
m_sbi.m_sparsesdf.Initialize();
m_sbi.m_sparsesdf.Reset();
}
btSoftRigidDynamicsWorld::~btSoftRigidDynamicsWorld()
{
}
void btSoftRigidDynamicsWorld::predictUnconstraintMotion(btScalar timeStep)
{
btDiscreteDynamicsWorld::predictUnconstraintMotion( timeStep);
for ( int i=0;i<m_softBodies.size();++i)
{
btSoftBody* psb= m_softBodies[i];
psb->predictMotion(timeStep);
}
}
void btSoftRigidDynamicsWorld::internalSingleStepSimulation( btScalar timeStep)
{
btDiscreteDynamicsWorld::internalSingleStepSimulation( timeStep );
///solve soft bodies constraints
solveSoftBodiesConstraints();
//self collisions
for ( int i=0;i<m_softBodies.size();i++)
{
btSoftBody* psb=(btSoftBody*)m_softBodies[i];
psb->defaultCollisionHandler(psb);
}
///update soft bodies
updateSoftBodies();
}
void btSoftRigidDynamicsWorld::updateSoftBodies()
{
BT_PROFILE("updateSoftBodies");
for ( int i=0;i<m_softBodies.size();i++)
{
btSoftBody* psb=(btSoftBody*)m_softBodies[i];
psb->integrateMotion();
}
}
void btSoftRigidDynamicsWorld::solveSoftBodiesConstraints()
{
BT_PROFILE("solveSoftConstraints");
if(m_softBodies.size())
{
btSoftBody::solveClusters(m_softBodies);
}
for(int i=0;i<m_softBodies.size();++i)
{
btSoftBody* psb=(btSoftBody*)m_softBodies[i];
psb->solveConstraints();
}
}
void btSoftRigidDynamicsWorld::addSoftBody(btSoftBody* body,short int collisionFilterGroup,short int collisionFilterMask)
{
m_softBodies.push_back(body);
btCollisionWorld::addCollisionObject(body,
collisionFilterGroup,
collisionFilterMask);
}
void btSoftRigidDynamicsWorld::removeSoftBody(btSoftBody* body)
{
m_softBodies.remove(body);
btCollisionWorld::removeCollisionObject(body);
}
void btSoftRigidDynamicsWorld::removeCollisionObject(btCollisionObject* collisionObject)
{
btSoftBody* body = btSoftBody::upcast(collisionObject);
if (body)
removeSoftBody(body);
else
btDiscreteDynamicsWorld::removeCollisionObject(collisionObject);
}
void btSoftRigidDynamicsWorld::debugDrawWorld()
{
btDiscreteDynamicsWorld::debugDrawWorld();
if (getDebugDrawer())
{
int i;
for ( i=0;i<this->m_softBodies.size();i++)
{
btSoftBody* psb=(btSoftBody*)this->m_softBodies[i];
btSoftBodyHelpers::DrawFrame(psb,m_debugDrawer);
btSoftBodyHelpers::Draw(psb,m_debugDrawer,m_drawFlags);
if (m_debugDrawer && (m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawAabb))
{
if(m_drawNodeTree) btSoftBodyHelpers::DrawNodeTree(psb,m_debugDrawer);
if(m_drawFaceTree) btSoftBodyHelpers::DrawFaceTree(psb,m_debugDrawer);
if(m_drawClusterTree) btSoftBodyHelpers::DrawClusterTree(psb,m_debugDrawer);
}
}
}
}
| [
"[email protected]"
] | [
[
[
1,
151
]
]
] |
a04031f013467cae89c88f362e80a91cf1e9467c | 5bd189ea897b10ece778fbf9c7a0891bf76ef371 | /BasicEngine/BasicEngine/Input/InputManager.h | 7856bd01747d06c1b3c8831f75c64f0ebefb0159 | [] | no_license | boriel/masterullgrupo | c323bdf91f5e1e62c4c44a739daaedf095029710 | 81b3d81e831eb4d55ede181f875f57c715aa18e3 | refs/heads/master | 2021-01-02T08:19:54.413488 | 2011-12-14T22:42:23 | 2011-12-14T22:42:23 | 32,330,054 | 0 | 0 | null | null | null | null | ISO-8859-3 | C++ | false | false | 1,905 | h | /*
Clase InputManager. Esta clase se encarga de actualizar y leer los dispositivos, y con la información
que obtiene de ellos actualiza las acciones correspondientes
*/
#ifndef Input_Manager_H__
#define Input_Manager_H__
#include <vector>
#include "InputAction.h"
#include "InputEntry.h"
#include "KeyBoard.h"
#include "Pad.h"
#include "Mouse.h"
//#include "GenericDevice.h"
#include "..\Utility\Singleton.h"
#define IsPressed(ACTION) cInputManager::Get().GetAction( ACTION ).GetIsPressed()
#define BecomePressed(ACTION) cInputManager::Get().GetAction( ACTION ).GetBecomePressed()
#define BecomeReleased(ACTION) cInputManager::Get().GetAction( ACTION ).GetBecomeReleased()
class OIS::InputManager;
//Identifica los dispositivos de entrada a traves de un enum
enum eDevices
{
eKeyboard = 0,
eMouse = 1
};
struct tActionMapping
{
int miAction; //identificador de la accion
int miDevice; //identificador del dispositivo al que se va a mapear la acción
int miChannel; //es el canal dentro del dispositivo
};
class cInputManager : public cSingleton<cInputManager>
{
public:
void Init(const tActionMapping laActionMapping[], unsigned luiActionCount);
void Deinit();
void Update(const float &lfTimestep);
inline cInputAction &GetAction(const int &liActionId) { return mActions[liActionId]; };
friend class cSingleton<cInputManager>;
protected:
cInputManager() { ; } // Protected constructor
private:
float Check(int liDevice, int liChannel);
std::vector <cInputAction> mActions; //se encarga de mantener el estado de cada una de las acciones.
std::vector <cGenericDevice *> mDevices;
std::vector <std::vector <cInputEntry> > mMapped;
// Specific OIS vars
friend class cKeyboard;
friend class cPad;
friend class cMouse;
OIS::InputManager* mpOISInputManager;
};
#endif | [
"yormanh@f2da8aa9-0175-0678-5dcd-d323193514b7",
"[email protected]@f2da8aa9-0175-0678-5dcd-d323193514b7",
"[email protected]@f2da8aa9-0175-0678-5dcd-d323193514b7",
"[email protected]@f2da8aa9-0175-0678-5dcd-d323193514b7"
] | [
[
[
1,
12
],
[
15,
19
],
[
22,
28
],
[
31,
51
],
[
53,
67
],
[
70,
76
]
],
[
[
13,
13
],
[
20,
20
],
[
52,
52
],
[
68,
68
]
],
[
[
14,
14
],
[
29,
30
],
[
69,
69
]
],
[
[
21,
21
]
]
] |
e8997ab4f9144878f6be6d69e68a4e345c0ac23e | d4010a4208cb83e1ac64ddafb4da4ead8f5368d0 | /example_game_file.cpp | 4d69bf23eaaf272834fe81bfc050dc047f2cbf57 | [] | no_license | sampyxis/lcdgameengine | 2db0ef46c5e7933aa4eb4894bd539e73f7c07e38 | 60e2a42d531562d3192ddde715b986b9c2891d24 | refs/heads/master | 2020-03-30T16:06:44.706674 | 2010-09-18T03:10:32 | 2010-09-18T03:10:32 | 32,144,172 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 284 | cpp | //
//
// Simple program to test
// Take a bitmap and run through the joystick functions
//
//
#include "game_engine.h"
// Player
static unsigned char __attribute__ ((progmem)) player_bmp[]= {
0x30, 0x78, 0xFE, 0xC7, 0xC7, 0xFE, 0x78, 0x30
};
void mainLoop1()
{
}
| [
"sampyxis@4fafe0fb-6237-5464-ab3f-925d16043ff4"
] | [
[
[
1,
17
]
]
] |
107b3678900c462bd22afb8821d06f2314d3b234 | 3920e5fc5cbc2512701a3d2f52e072fd50debb83 | /Source/Common/itkManagedPipeline.cxx | a9a988e86638ddd49bd6dba4f75fa0fbfd99befa | [
"MIT"
] | permissive | amirsalah/manageditk | 4063a37d7370dcbcd08bfe9d24d22015d226ceaf | 1ca3a8ea7db221a3b6a578d3c75e3ed941ef8761 | refs/heads/master | 2016-08-12T05:38:03.377086 | 2010-08-02T08:17:32 | 2010-08-02T08:17:32 | 52,595,294 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,297 | cxx | /*=============================================================================
NOTE: THIS FILE IS A HANDMADE WRAPPER FOR THE ManagedITK PROJECT.
Project: ManagedITK
Program: Insight Segmentation & Registration Toolkit
Module: itkManagedPipeline.cxx
Language: C++/CLI
Author: Dan Mueller
Date: $Date: 2008-03-09 19:29:02 +0100 (Sun, 09 Mar 2008) $
Revision: $Revision: 8 $
Portions of this code are covered under the ITK and VTK copyright.
See http://www.itk.org/HTML/Copyright.htm for details.
See http://www.vtk.org/copyright.php for details.
Copyright (c) 2007-2008 Daniel Mueller
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=============================================================================*/
#pragma once
#pragma warning( disable : 4635 ) // Disable warnings about XML doc comments
#ifndef __itkManagedPipeline_cxx
#define __itkManagedPipeline_cxx
// Include some useful ManagedITK files
#include "itkManagedDataObject.cxx"
#include "itkManagedProcessObject.cxx"
#include "itkManagedImageSource.cxx"
#include "itkManagedImageToImageFilter.cxx"
// Use some managed namespaces
#using <mscorlib.dll>
#using <System.dll>
using namespace System;
using namespace System::IO;
using namespace System::Reflection;
using namespace System::ComponentModel;
using namespace System::Diagnostics;
using namespace System::Collections::Generic;
namespace itk
{
///<summary>
///A class for grouping filters into a simple itkPipeline object.
///Add filters using the AddFilter() or SetFilter() methods, add inputs using
///the SetInput() method, get outputs using the GetOutput() method,
///and update the Pipeline using the Update() method. Filters must be added BEFORE
///the Input/Output/Update methods can be called.
///</summary>
///<remarks>
///The pipeline can work for internal filters which expect multiple inputs by
///explicitly setting the inputs instead of or after calling
///ConnectInternalFiltersInputsAndOutputs().
///</remarks>
public ref class itkPipeline
{
private:
bool m_IsDisposed;
List<itkImageToImageFilter^>^ m_Filters;
///<summary>Initialise the pipeline.</summary>
void Initialise ( )
{
this->m_IsDisposed = false;
this->m_Filters = gcnew List<itkImageToImageFilter^>();
}
public:
///<summary>Default constructor which creates an empty list of filters.</summary>
itkPipeline ( )
{
this->Initialise();
}
///<summary>Constructor taking the list of filters.</summary>
///<param name="filters">The list of filter instance objects in this pipline.</param>
itkPipeline ( ... array<itkImageToImageFilter^>^ filters )
{
this->Initialise();
for each ( itkImageToImageFilter^ filter in filters)
this->m_Filters->Add( filter );
}
///<summary>Dispose of the managed object.</summary>
~itkPipeline ( )
{
if (!this->m_IsDisposed)
{
// Mark as disposed
this->m_IsDisposed = true;
// Dispose of each filter
for each ( itkImageToImageFilter^ filter in this->m_Filters )
{
if (filter != nullptr && !filter->IsDisposed) delete filter;
}
// Clean up the list of filters
this->m_Filters->Clear();
this->m_Filters = nullptr;
}
}
///<summary>Get the list of filters comprising this pipeline.</summary>
///<remarks>Filters can be added to this pipeline using Filters.Add() or AddFilters().</remarks>
property List<itkImageToImageFilter^>^ Filters
{
virtual List<itkImageToImageFilter^>^ get() { return this->m_Filters; }
}
///<summary>Add a filter to the end of the pipeline.</summary>
///<param name="filter">The filter to add to the end of the pipeline.</param>
///<remarks>Filters can be added to this pipeline using Filters.Add() or AddFilters().</remarks>
virtual void AddFilter( itkImageToImageFilter^ filter )
{
this->m_Filters->Add( filter );
}
///<summary>
///Set the filter at the specified position in the pipeline.
///The index must be less than Filters.Length, otherwise an IndexOutOfRangeException
///will be thrown.
///</summary>
///<param name="index">The index of the filter to set.</param>
///<param name="filter">The filter object to set.</param>
virtual void SetFilter( unsigned int index, itkImageToImageFilter^ filter )
{
this->m_Filters[index] = filter;
}
///<summary>Set the first input of the pipeline object.</summary>
///<param name="input">The input as an itkDataObject.</param>
///<remarks>The first filter must be added to the pipeline before calling this method.</remarks>
virtual void SetInput( itkDataObject^ input )
{
this->m_Filters[0]->SetInput( input );
}
///<summary>Set the specified input of the pipeline object.</summary>
///<param name="input">The input as an itkDataObject.</param>
///<remarks>The first filter must be added to the pipeline before calling this method.</remarks>
virtual void SetInput(unsigned int index, itkDataObject^ input)
{
this->m_Filters[0]->SetInput( index, input );
}
///<summary>
///Connects the output of each internal filter to the input of the next filter.
///</summary>
///<remarks>
///This method has no effect if the number of internal filters is one.
///</remarks>
virtual void ConnectInternalFiltersInputsAndOutputs( )
{
// Connect the output to the input of the next filter
for (int i=1; i < this->m_Filters->Count; i++)
this->m_Filters[i]->SetInput( this->m_Filters[i-1]->GetOutput() );
}
///<summary>
///Call Update() on the last filter in the pipeline.
///</summary>
///<remarks>
///The user must have already connected the internal filter inputs and outputs by
///calling or ConnectInternalFiltersInputsAndOutputs or by explicitly setting them.
///</remarks>
virtual void Update ( )
{
// Update the last filter
this->m_Filters[this->m_Filters->Count - 1]->Update();
}
///<summary>Get the first output of the pipeline object.</summary>
///<param name="output">The itkDataObject to make as the output.</param>
///<remarks>All filters must be added to the pipeline before calling this method.</remarks>
virtual void GetOutput( itkDataObject^ output )
{
this->m_Filters[this->m_Filters->Count - 1]->GetOutput( output );
}
///<summary>Get the specified output of the pipeline object.</summary>
///<param name="output">The itkDataObject to make as the output.</param>
///<remarks>All filters must be added to the pipeline before calling this method.</remarks>
virtual void GetOutput(unsigned int index, itkDataObject^ output)
{
this->m_Filters[this->m_Filters->Count - 1]->GetOutput( index, output );
}
///<summary>
///Converts the itkPipeline to a string representation.
///Eg. "itkTest1ImageFilter -> itkTest2ImageFilter".
///</summary>
///<returns>A string represetnation of the itkPipeline.</returns>
virtual String^ ToString() override
{
String^ result = String::Empty;
for each (itkProcessObject^% filter in this->m_Filters)
result += filter->Name + " -> ";
result->TrimEnd( ' ', '-', '>' );
return result;
}
}; // end ref class
} // end namespace itk
#endif | [
"dan.muel@a4e08166-d753-0410-af4e-431cb8890a25"
] | [
[
[
1,
230
]
]
] |
2368c2b967e249fcadfa5b53815e1366270f046c | 215fd760efb591ab13e10c421686fef079d826e1 | /src/p4dn/ClientApi_m.cpp | 0de356dfc98dbf90c2ac2148dada47c793841a51 | [] | no_license | jairbubbles/P4.net | 2021bc884b9940f78e94b950e22c0c4e9ce8edca | 58bbe79b30593134a9306e3e37b0b1aab8135ed0 | refs/heads/master | 2020-12-02T16:21:15.361000 | 2011-02-15T19:28:31 | 2011-02-15T19:28:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,388 | cpp | /*
* P4.Net *
Copyright (c) 2007-2010 Shawn Hladky
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//
// Copyright 2010 Jacob Gladish. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY Jacob Gladish ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// The views and conclusions contained in the software and documentation are those of the
// authors and should not be interpreted as representing official policies, either expressed
// or implied, of <copyright holder>.
//
#include "StdAfx.h"
#include "clientapi_m.h"
#include "i18napi.h"
using namespace System::Runtime::InteropServices;
p4dn::ClientApi::ClientApi()
{
_Disposed = false;
_clientApi = new ::ClientApi();
_keepAliveDelegate = NULL;
// default to non-unicode server use ANSI encoding
_encoding = System::Text::Encoding::GetEncoding(1252);
}
p4dn::ClientApi::~ClientApi()
{
_Disposed = true;
CleanUp();
}
::ClientApi* p4dn::ClientApi::getClientApi()
{
// Oops someone called dispose too early!!!
if (_Disposed)
{
//used to throw an exception here, but it seems to just cause other errror
return NULL;
}
return _clientApi;
}
void p4dn::ClientApi::CleanUp()
{
if (_clientApi != NULL) delete _clientApi;
if (_keepAliveDelegate != NULL) delete _keepAliveDelegate;
_clientApi = NULL;
_keepAliveDelegate = NULL;
}
void p4dn::ClientApi::SetMaxResults(int maxResults)
{
if( maxResults ) getClientApi()->SetVar( "maxResults", maxResults );
}
void p4dn::ClientApi::SetMaxScanRows(int maxScanRows)
{
if( maxScanRows ) getClientApi()->SetVar( "maxScanRows", maxScanRows );
}
void p4dn::ClientApi::SetMaxLockTime(int maxLockTime)
{
if( maxLockTime ) getClientApi()->SetVar( "maxLockTime", maxLockTime );
}
void p4dn::ClientApi::SetTrans( int output, int content, int fnames, int dialog )
{
getClientApi()->SetTrans( output, content, fnames, dialog );
}
void p4dn::ClientApi::SetProtocol( System::String^ p, System::String^ v )
{
StrBuf str_p; StrBuf str_v;
P4String::StringToStrBuf(&str_p, p, _encoding);
P4String::StringToStrBuf(&str_v, v , _encoding);
getClientApi()->SetProtocol( str_p.Text(), str_v.Text() );
}
void p4dn::ClientApi::SetArgv( array<System::String^>^ args )
{
StrBuf s;
for (int i = 0; i < args->Length; ++i) {
s.Clear();
P4String::StringToStrBuf(&s, args[i], _encoding);
getClientApi()->SetVar( "", &s );
}
}
void p4dn::ClientApi::SetProtocolV( System::String^ p )
{
StrBuf s;
P4String::StringToStrBuf(&s, p, _encoding);
getClientApi()->SetProtocolV( s.Text() );
}
System::String^ p4dn::ClientApi::GetProtocol( System::String^ v )
{
StrBuf s;
P4String::StringToStrBuf(&s, v, _encoding);
StrPtr* ptr = getClientApi()->GetProtocol( s.Text() );
return P4String::StrPtrToString(ptr, _encoding);
}
void p4dn::ClientApi::Init( p4dn::Error^ e )
{
if(getClientApi()->GetCharset().Length() > 0)
{
// unicode server use UTF-8
_encoding = gcnew System::Text::UTF8Encoding();
// set the translations (use UTF-8 for everything but content).
CharSetApi::CharSet content = CharSetApi::Lookup(getClientApi()->GetCharset().Text());
getClientApi()->SetTrans(CharSetApi::UTF_8, content,
CharSetApi::UTF_8, CharSetApi::UTF_8);
}
else
{
// non-unicode server use ANSI encoding
_encoding = System::Text::Encoding::GetEncoding(1252);
}
getClientApi()->Init( e->InternalError );
if (_keepAliveDelegate == NULL) _keepAliveDelegate = new KeepAliveDelegate();
// Always set the KeepAlive... only do something if a managed KeepAlive is present.
getClientApi()->SetBreak(_keepAliveDelegate);
}
void p4dn::ClientApi::Run( System::String^ func, p4dn::ClientUser^ ui )
{
StrBuf cmd;
P4String::StringToStrBuf(&cmd, func, _encoding);
ClientUserDelegate cud = ClientUserDelegate(ui, _encoding);
getClientApi()->Run(cmd.Text(), &cud);
}
p4dn::Error^ p4dn::ClientApi::CreateError()
{
return gcnew p4dn::Error(_encoding);
}
p4dn::Spec^ p4dn::ClientApi::CreateSpec(System::String^ specDef)
{
return gcnew p4dn::Spec(specDef, _encoding);
}
int p4dn::ClientApi::Final( p4dn::Error^ e )
{
::ClientApi* api = getClientApi();
if(NULL != api)
{
return api->Final( e->InternalError );
}
return 1;
}
int p4dn::ClientApi::Dropped()
{
return getClientApi()->Dropped();
}
//
// These functions are disabled. There will be a lot of work to enable
// asynchronous execution and ensure that all of references are released
// so managed objects are garbage collected
//
//void p4dn::ClientApi::RunTag( String* func, p4dn::ClientUser *ui )
//{
// char* f = (char *)(void *) Marshal::StringToHGlobalAnsi( func );
//ClientUserDelegate __nogc* cud = new ClientUserDelegate(ui);
// _clientApi->RunTag( f, cud);
//delete cud;
// Marshal::FreeHGlobal( f );
//}
//void p4dn::ClientApi::WaitTag( p4dn::ClientUser *ui )
//{
//ClientUserDelegate __nogc* cud = new ClientUserDelegate(ui);
// _clientApi->WaitTag( cud );
//delete cud;
//}
void p4dn::ClientApi::SetTag()
{
getClientApi()->SetVar( "tag", "");
//getClientApi()->SetVar( "specstring", "");
}
void p4dn::ClientApi::SetVar(System::String^ var, System::String^ val)
{
StrBuf sbVar, sbVal;
P4String::StringToStrBuf(&sbVar, var, _encoding);
P4String::StringToStrBuf(&sbVal, val, _encoding);
getClientApi()->SetVar( sbVar, sbVal);
}
void p4dn::ClientApi::SetCharset( String^ c )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->SetCharset( f.Text() );
}
void p4dn::ClientApi::SetClient( System::String^ c )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->SetClient( f.Text() );
}
void p4dn::ClientApi::SetCwd( System::String^ c )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->SetCwd( f.Text() );
}
void p4dn::ClientApi::SetHost( System::String^ c )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->SetHost( f.Text() );
}
void p4dn::ClientApi::SetLanguage( System::String^ c )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->SetLanguage( f.Text() );
}
void p4dn::ClientApi::SetPassword( System::String^ c )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->SetPassword( f.Text() );
}
void p4dn::ClientApi::SetPort( System::String^ c )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->SetPort( f.Text() );
}
void p4dn::ClientApi::SetProg( System::String^ c )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->SetProg( f.Text() );
}
void p4dn::ClientApi::SetVersion( System::String^ c )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->SetVersion( f.Text() );
}
void p4dn::ClientApi::SetTicketFile( System::String^ c )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->SetTicketFile( f.Text() );
}
void p4dn::ClientApi::SetUser( System::String^ c )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->SetUser( f.Text() );
}
void p4dn::ClientApi::SetBreak( p4dn::KeepAlive^ keepAlive )
{
_keepAliveDelegate->SetKeepAlive(keepAlive);
//getClientApi()->SetBreak(_keepAliveDelegate);
}
void p4dn::ClientApi::DefineCharset( System::String^ c, p4dn::Error^ e )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->DefineCharset( f.Text(), e->InternalError );
}
void p4dn::ClientApi::DefineClient( System::String^ c, p4dn::Error^ e )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->DefineClient( f.Text(), e->InternalError );
}
void p4dn::ClientApi::DefineHost( System::String^ c, p4dn::Error^ e )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->DefineHost( f.Text(), e->InternalError );
}
void p4dn::ClientApi::DefineLanguage( System::String^ c, p4dn::Error^ e )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->DefineLanguage( f.Text(), e->InternalError );
}
void p4dn::ClientApi::DefinePassword( System::String^ c, p4dn::Error^ e )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->DefinePassword( f.Text(), e->InternalError );
}
void p4dn::ClientApi::DefinePort( System::String^ c, p4dn::Error^ e )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->DefinePort( f.Text(), e->InternalError );
}
void p4dn::ClientApi::DefineUser( System::String^ c, p4dn::Error^ e )
{
StrBuf f;
P4String::StringToStrBuf(&f, c, _encoding);
getClientApi()->DefineUser(f.Text(), e->InternalError );
}
| [
"[email protected]"
] | [
[
[
1,
364
]
]
] |
71f924fe677a6029f8113f5953b445d7936e5545 | 62bc2e657a042a7755595859ba9aa63283332a32 | /cpp/RayTracer/RayTracer.cpp | fda27da3e956a2e4e863b84b21a3dd20338a403e | [] | no_license | nyanpasu64/makc | e1728cd903f2db596565b7c8a8c557f7a8ee12d9 | b05773e2693f1aa9724ec247886f600a2dadd508 | refs/heads/master | 2021-05-31T23:26:22.384255 | 2011-11-03T00:30:07 | 2011-11-03T00:30:07 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,402 | cpp | // RayTracer.cpp
// Hybrid of ambient occlusion and environment mapping
#include <atlbase.h> // CComBSTR (also helps gdiplus.h to compile :)
#include <gdiplus.h> // (add gdiplus.lib)
#include <conio.h>
#include <stdio.h>
#include <sys/stat.h>
#include <math.h>
#include <time.h>
#ifndef PI
#define PI 3.1415926535897932384626433832795
#endif
#include "fractals.h"
#define DITHERING true
#define FOV_ATAN 1.5 // 1 = 90 deg, infinity = 180 deg
#define S 666 // tracing SxS bitmap
#define N 7 // rays per ray per generation
#define TTL 2 // generations: rays per pixel should be < N^TTL
#define STEP 0.00002 // 0.0 < STEP << 1.0
#define PRECISION 0.000001 * 0.000001
#define RAYS_EFFICIENCY 0.2 /* expected share of rays that will reach the sky */
struct Pixel {
unsigned char B;
unsigned char G;
unsigned char R;
unsigned char A;
};
struct Ray {
int generation;
double magnitude, x, y, z, dx, dy, dz;
static void Clear (Ray *r) {
r->generation = 0; r->magnitude = 1; r->x = 0; r->y = 0; r->z = 0;
}
Ray::Ray () {
Clear (this);
}
};
bool FileExists(char *filename);
void showSysErrMsg (char *unknown);
#define STRIDE_3ALIGN4(W) (((3*((W)+1))>>2)*4)
void saveBitmap(unsigned char *pBuffer, char *pFileName);
unsigned char *loadBitmap (char *fname);
double random () { return double (rand ()) / RAND_MAX; }
int main(int argc, char* argv[])
{
unsigned int t; time ((time_t *)&t); srand (t % RAND_MAX); random ();
Gdiplus::GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken;
Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
// 1st load lightmap
unsigned char *pLightmapBitmap = loadBitmap ("lightmap.jpg");
if (pLightmapBitmap == NULL) {
if (!FileExists ("lightmap.jpg"))
puts ("lightmap not found :(");
else
showSysErrMsg ("random GDI failure :(");
return 1;
}
unsigned char *lightmap = (pLightmapBitmap + (WORD)(((PBITMAPINFOHEADER)pLightmapBitmap)->biSize));
int lmWidth = ((PBITMAPINFOHEADER) pLightmapBitmap)->biWidth;
int lmHeight = ((PBITMAPINFOHEADER) pLightmapBitmap)->biHeight;
int lmStride = STRIDE_3ALIGN4 (lmWidth);
int SS = S * S;
int iWidth = S;
int iHeight = S;
int iStride = STRIDE_3ALIGN4 (iWidth);
int iBufferLength = sizeof (BITMAPINFOHEADER) + iStride * iHeight;
unsigned char *pCanvasBitmap = new unsigned char [iBufferLength]; ZeroMemory (pCanvasBitmap, iBufferLength);
PBITMAPINFOHEADER pbih = (PBITMAPINFOHEADER) pCanvasBitmap; ZeroMemory (pbih, sizeof (BITMAPINFOHEADER));
pbih->biBitCount = 24; pbih->biCompression = BI_RGB; pbih->biHeight = iHeight; pbih->biWidth = iWidth;
pbih->biPlanes = 1; pbih->biSize = sizeof (BITMAPINFOHEADER); pbih->biSizeImage = iStride * pbih->biHeight;
pbih->biXPelsPerMeter = pbih->biYPelsPerMeter = 0;
unsigned char *canvas = (pCanvasBitmap + (WORD)(((PBITMAPINFOHEADER)pCanvasBitmap)->biSize));
// init raytracer
double red;
double green;
double blue;
int i, j, k, m = 1, num = 1; for (i = 0; i < TTL; i++) { m *= N; num += m; }
Ray *rays = new Ray [num];
Ray *directions = new Ray [N];
// uniformly distributed directions:
// Bauer, Robert, "Distribution of Points on a Sphere with Application to Star Catalogs",
// Journal of Guidance, Control, and Dynamics, January-February 2000, vol.23 no.1 (130-137).
for (i = 1; i <= N; i++) {
Ray &d = directions [i - 1];
double phi = acos ( -1.0 + (2.0 * i -1.0) / N);
double theta = sqrt (N * PI) * phi;
d.dx = cos (theta) * sin (phi);
d.dy = sin (theta) * sin (phi);
d.dz = cos (phi);
}
// select random spot on unit sphere
k = int (random () * N) % N;
double camPosX = directions [k].dx;
double camPosY = directions [k].dy;
double camPosZ = directions [k].dz;
// select random camera orientation
k = int (random () * N) % N;
double camFwdX = 0.3 * directions [k].dx - camPosX;
double camFwdY = 0.3 * directions [k].dy - camPosY;
double camFwdZ = 0.3 * directions [k].dz - camPosZ;
double camFwdL = 1 / sqrt (camFwdX * camFwdX + camFwdY * camFwdY + camFwdZ * camFwdZ);
camFwdX *= camFwdL; camFwdY *= camFwdL; camFwdZ *= camFwdL;
// unless we are extremely unlucky, camFwdZ should be never 0
double camUpX = 0;
double camUpY = camFwdZ;
double camUpZ = -camFwdY;
double camUpL = 1 / sqrt (camUpX * camUpX + camUpY * camUpY + camUpZ * camUpZ);
camUpX *= camUpL; camUpY *= camUpL; camUpZ *= camUpL;
double camSideX = camFwdY * camUpZ - camUpY * camFwdZ;
double camSideY = camFwdZ * camUpX - camUpZ * camFwdX;
double camSideZ = camFwdX * camUpY - camUpX * camFwdY;
// output C++ code to override orientation
printf ("camPosX = %f;\n", camPosX);
printf ("camPosY = %f;\n", camPosY);
printf ("camPosZ = %f;\n", camPosZ);
printf ("camFwdX = %f;\n", camFwdX);
printf ("camFwdY = %f;\n", camFwdY);
printf ("camFwdZ = %f;\n", camFwdZ);
printf ("camUpX = %f;\n", camUpX);
printf ("camUpY = %f;\n", camUpY);
printf ("camUpZ = %f;\n", camUpZ);
printf ("camSideX = %f;\n", camSideX);
printf ("camSideY = %f;\n", camSideY);
printf ("camSideZ = %f;\n", camSideZ);
if (!false) {
// to set specific orientation
camPosX = -0.498168;
camPosY = 0.334408;
camPosZ = 0.800000;
camFwdX = 0.454971;
camFwdY = -0.593262;
camFwdZ = -0.664109;
camUpX = 0.000000;
camUpY = -0.745766;
camUpZ = 0.666208;
camSideX = -0.890506;
camSideY = -0.303105;
camSideZ = -0.339302;
}
// stats for real RAYS_EFFICIENCY
// (so that you can run small resolution test and fix it accordingly)
int rre_r = 0, rre_n = 0;
double ns = RAYS_EFFICIENCY * num;
for (i = 0; i < S; i++) {
for (j = 0; j < S; j++) {
red = 0; green = 0; blue = 0; rre_n++;
for (k = 0; k < 1; k++) {
// generation zero
Ray &r = rays [0]; Ray::Clear (&r);
r.x = camPosX; r.dx = camFwdX + ((i - 0.5 * S) * camUpX + (j - 0.5 * S) * camSideX) * FOV_ATAN / S;
r.y = camPosY; r.dy = camFwdY + ((i - 0.5 * S) * camUpY + (j - 0.5 * S) * camSideY) * FOV_ATAN / S;
r.z = camPosZ; r.dz = camFwdZ + ((i - 0.5 * S) * camUpZ + (j - 0.5 * S) * camSideZ) * FOV_ATAN / S;
double rdL = 1 / sqrt (r.dx * r.dx + r.dy * r.dy + r.dz * r.dz);
r.dx *= rdL; r.dy *= rdL; r.dz *= rdL;
m = 0; int used = 1;
while (m < used) {
// process one ray
Ray &r = rays [m];
double step = appDist (r.x, r.y, r.z);
if (step < STEP) step = STEP;
double rx0 = r.x, rx1 = r.x + r.dx * step, rx = rx1;
double ry0 = r.y, ry1 = r.y + r.dy * step, ry = ry1;
double rz0 = r.z, rz1 = r.z + r.dz * step, rz = rz1;
if (hitTest (rx, ry, rz)) while (
(rx1 - rx0) * (rx1 - rx0) +
(ry1 - ry0) * (ry1 - ry0) +
(rz1 - rz0) * (rz1 - rz0) > PRECISION) {
// http://www.codinginstinct.com/2008/11/raytracing-4d-fractals-visualizing-four.html
rx = 0.5 * (rx0 + rx1); ry = 0.5 * (ry0 + ry1); rz = 0.5 * (rz0 + rz1);
if (hitTest (rx, ry, rz)) {
rx1 = rx; ry1 = ry; rz1 = rz;
} else {
rx0 = rx; ry0 = ry; rz0 = rz;
}
}
r.x = rx1; r.y = ry1; r.z = rz1;
if (hitTest (r.x, r.y, r.z)) {
// we hit something - scatter
if (r.generation < TTL) {
for (int n1 = 0; n1 < N; n1++) {
if (used < num) {
Ray &r1 = rays [used];
r1.generation = r.generation + 1;
r1.x = r.x; r1.y = r.y; r1.z = r.z;
r1.dx = directions [n1].dx;
r1.dy = directions [n1].dy;
r1.dz = directions [n1].dz;
// this basically defines "material"
r1.magnitude = r.magnitude * 0.9;
used++;
} else {
// rays pool exhausted :(\n");
break;
}
}
}
m++;
} else {
double d2 = r.x * r.x + r.y * r.y + r.z * r.z;
if (d2 > 1.1) {
// radialize
r.x += 1e4 * r.dx;
r.y += 1e4 * r.dy;
r.z += 1e4 * r.dz;
d2 = r.x * r.x + r.y * r.y + r.z * r.z;
// we hit light - get color from lightmap
// this SHOULD be determined by the way lightmap is made ;)
d2 = 1 / sqrt (d2); r.x *= d2; r.y *= d2; r.z *= d2;
int lx = int (lmWidth * 0.25 * ( (r.z > 0) ? 1 + r.x : 3 - r.x ));
if (lx > lmWidth - 1) lx = lmWidth - 1; else if (lx < 0) lx = 0;
int ly = int (lmHeight * 0.5 * (1 + r.y));
if (ly > lmHeight - 1) ly = lmHeight - 1; else if (ly < 0) ly = 0;
Pixel *c = (Pixel *) &lightmap [lx * 3 + ly * lmStride];
// sky hack
if (r.generation == 0) {
r.magnitude = ns; rre_n--;
} else {
rre_r++;
}
red += r.magnitude * c->R;
green += r.magnitude * c->G;
blue += r.magnitude * c->B;
m++;
}
}
}
}
// set pixel
int ir = int (red / ns);
int ig = int (green / ns);
int ib = int (blue / ns);
if (DITHERING) {
if (random () < red / ns - ir) ir++;
if (random () < green / ns - ig) ig++;
if (random () < blue / ns - ib) ib++;
}
if (ir > 255) ir = 255;
if (ig > 255) ig = 255;
if (ib > 255) ib = 255;
Pixel *c = (Pixel *) &canvas [i * 3 + j * iStride];
c->R = unsigned char (ir);
c->G = unsigned char (ig);
c->B = unsigned char (ib);
}
printf ("\rScanline %d of %d (%d%%)", (i+1), S, int (double(100 * (i+1)) / S));
if (kbhit()) {
printf ("\n\nExit [y/n]? ");
int ch = getchar ();
if ((ch == 'y') || (ch == 'Y')) break;
}
}
saveBitmap (pCanvasBitmap, "render.bmp");
printf ("\n\n");
printf ("Efficient rays per pixel %f (estimate %f) out of possible %d (ratio %f)\n",
double (rre_r) / rre_n, ns, num, ( double (rre_r) / rre_n ) / num);
// release stuff
delete [] directions;
delete [] rays;
delete [] pCanvasBitmap;
delete [] pLightmapBitmap;
Gdiplus::GdiplusShutdown(gdiplusToken);
return 0;
}
// misc. boring func-s
bool FileExists(char *filename) {
struct stat stFileInfo;
bool blnReturn;
int intStat;
intStat = stat(filename, &stFileInfo);
if(intStat == 0) {
blnReturn = true;
} else {
// We were not able to get the file attributes.
// This may mean that we don't have permission to
// access the folder which contains this file.
blnReturn = false;
}
return(blnReturn);
}
void showSysErrMsg (char *unknown) {
#define EC_MAXCHARS 1024
char msgSysInfo [EC_MAXCHARS + 1]; SecureZeroMemory (msgSysInfo, sizeof (msgSysInfo));
DWORD sysErrCode = GetLastError ();
if (sysErrCode != ERROR_SUCCESS) {
LPVOID lpMsgBuf;
if (FormatMessage (
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
sysErrCode,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL ) == 0) {
// no message found for sysErrCode, put the code itself in msgSysInfo
_snprintf (msgSysInfo, EC_MAXCHARS, "Last error code value was %d.", sysErrCode);
} else {
// copy lpMsgBuf to msgSysInfo and release memory
_snprintf (msgSysInfo, EC_MAXCHARS, "Error %d: %s", sysErrCode, (LPCTSTR)lpMsgBuf);
LocalFree (lpMsgBuf);
}
puts (msgSysInfo);
} else {
puts (unknown);
}
#undef EC_MAXCHARS
}
void saveBitmap(unsigned char *pBuffer, char *pFileName) {
PBITMAPINFOHEADER pbih = (PBITMAPINFOHEADER) pBuffer;
DWORD dwTmp;
HANDLE hf = CreateFile(pFileName,
GENERIC_READ | GENERIC_WRITE,
(DWORD) 0,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
(HANDLE) NULL);
if (hf == INVALID_HANDLE_VALUE)
return/*throw 0*/;
BITMAPFILEHEADER hdr;
hdr.bfType = 0x4d42; // 0x42 = "B" 0x4d = "M"
hdr.bfSize = (DWORD) (sizeof(BITMAPFILEHEADER) +
pbih->biSize + pbih->biClrUsed
* sizeof(RGBQUAD) + pbih->biSizeImage);
hdr.bfReserved1 = hdr.bfReserved2 = 0;
hdr.bfOffBits = (DWORD) sizeof(BITMAPFILEHEADER) +
pbih->biSize + pbih->biClrUsed
* sizeof (RGBQUAD);
if (!WriteFile(hf, (LPVOID) &hdr, sizeof(BITMAPFILEHEADER), (LPDWORD) &dwTmp, NULL))
return/*throw 0*/;
if (!WriteFile(hf, (LPVOID) pbih, sizeof(BITMAPINFOHEADER) + pbih->biClrUsed * sizeof (RGBQUAD), (LPDWORD) &dwTmp, NULL))
return/*throw 0*/;
LPBYTE lpBits = ((LPBYTE)pbih + (WORD)(pbih->biSize));
if (!WriteFile(hf, (LPSTR) lpBits, (int) pbih->biSizeImage, (LPDWORD) &dwTmp, NULL))
return/*throw 0*/;
if (FAILED(CloseHandle(hf)))
return/*throw 0*/;
}
unsigned char *loadBitmap (char *fname) {
// Create initial Bitmap object
CComBSTR bstrfname (fname);
Gdiplus::Bitmap *pBitmap = Gdiplus::Bitmap::FromFile (bstrfname);
if (pBitmap == NULL) {
return NULL;
}
// Get bitmap data in RGB-24 format (do we really need to initialize bd here ?)
Gdiplus::BitmapData bd; bd.Scan0 = NULL; bd.PixelFormat = PixelFormat24bppRGB;
bd.Width = pBitmap->GetWidth (); bd.Height = pBitmap->GetHeight (); bd.Stride = STRIDE_3ALIGN4 (bd.Width);
Gdiplus::Rect rect (0, 0, (INT)bd.Width, (INT)bd.Height);
Gdiplus::Status res = pBitmap->LockBits (&rect, Gdiplus::ImageLockModeRead, bd.PixelFormat, &bd);
if ((res != Gdiplus::Ok) || (bd.PixelFormat != PixelFormat24bppRGB)) {
return NULL;
}
// construct valid BITMAPINFOHEADER in pBuffer and append bd data there
unsigned char *pBuffer;
try {
pBuffer = new unsigned char [sizeof (BITMAPINFOHEADER) + STRIDE_3ALIGN4 (bd.Width) * bd.Height];
} catch (...) {
// swallow any allocation errors here to return NULL
}
if (pBuffer == NULL) {
return NULL;
}
PBITMAPINFOHEADER pbih = (PBITMAPINFOHEADER) pBuffer; ZeroMemory (pbih, sizeof (BITMAPINFOHEADER));
pbih->biBitCount = 24; pbih->biCompression = BI_RGB; pbih->biHeight = bd.Height; pbih->biWidth = bd.Width;
pbih->biPlanes = 1; pbih->biSize = sizeof (BITMAPINFOHEADER); pbih->biSizeImage = STRIDE_3ALIGN4 (pbih->biWidth) * pbih->biHeight;
pbih->biXPelsPerMeter = pbih->biYPelsPerMeter = 0; // TODO: aspect ???
memcpy ((LPBYTE)pbih + (WORD)(pbih->biSize), bd.Scan0, pbih->biSizeImage);
// Release GDI+ stuff
pBitmap->UnlockBits (&bd); delete pBitmap;
return pBuffer;
} | [
"makc.the.great@1eff5426-bb48-0410-838f-eba945681aae"
] | [
[
[
1,
452
]
]
] |
e4ea2779e6d24cc836eb56813d35c63f2b0aba7e | b2155efef00dbb04ae7a23e749955f5ec47afb5a | /source/libOEBase/IOEMsg.cpp | 66b45b9adcb66432553ba05f5baf08675e58596f | [] | no_license | zjhlogo/originengine | 00c0bd3c38a634b4c96394e3f8eece86f2fe8351 | a35a83ed3f49f6aeeab5c3651ce12b5c5a43058f | refs/heads/master | 2021-01-20T13:48:48.015940 | 2011-04-21T04:10:54 | 2011-04-21T04:10:54 | 32,371,356 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 539 | cpp | /*!
* \file IOEMsg.cpp
* \date 8-17-2010 20:07:21
*
*
* \author zjhlogo ([email protected])
*/
#include <libOEBase/IOEMsg.h>
IOEMsg::IOEMsg(uint nMsgID)
{
m_nMsgID = nMsgID;
}
IOEMsg::IOEMsg(COEDataBufferRead* pDBRead)
{
pDBRead->Read(&m_nMsgID, sizeof(m_nMsgID));
}
IOEMsg::~IOEMsg()
{
// TODO:
}
uint IOEMsg::GetMsgID() const
{
return m_nMsgID;
}
bool IOEMsg::ConvertToBuffer(COEDataBufferWrite* pDBWrite)
{
pDBWrite->Write(&m_nMsgID, sizeof(m_nMsgID));
return ToBuffer(pDBWrite);
}
| [
"zjhlogo@fdcc8808-487c-11de-a4f5-9d9bc3506571"
] | [
[
[
1,
34
]
]
] |
0b3af0e75d1507b73631296c890e680eef176cc0 | fd792229322e4042f6e88a01144665cebdb1c339 | /vc/dependencies/raknet/include/RakNet/Router2.h | 295ce6a1a8b03c342a2e3660a8052426f11c2e72 | [] | no_license | weimingtom/mmomm | 228d70d9d68834fa2470d2cd0719b9cd60f8dbcd | cab04fcad551f7f68f99fa0b6bb14cec3b962023 | refs/heads/master | 2021-01-10T02:14:31.896834 | 2010-03-15T16:15:43 | 2010-03-15T16:15:43 | 44,764,408 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,220 | h | /// \file
/// \brief Router2 plugin. Allows you to connect to a system by routing packets through another system that is connected to both you and the destination. Useful for getting around NATs.
///
/// This file is part of RakNet Copyright 2003 Jenkins Software LLC
///
/// Usage of RakNet is subject to the appropriate license agreement.
#ifndef __ROUTER_2_PLUGIN_H
#define __ROUTER_2_PLUGIN_H
class RakPeerInterface;
#include "RakNetTypes.h"
#include "PluginInterface2.h"
#include "PacketPriority.h"
#include "Export.h"
#include "UDPForwarder.h"
#include "MessageIdentifiers.h"
namespace RakNet
{
/// \defgroup ROUTER_2_GROUP Router2
/// \brief Part of the NAT punchthrough solution, allowing you to connect to systems by routing through a shared connection.
/// \details
/// \ingroup PLUGINS_GROUP
/// \ingroup ROUTER_2_GROUP
/// \brief Class interface for the Router2 system
/// \details
class RAK_DLL_EXPORT Router2 : public PluginInterface2
{
public:
Router2();
virtual ~Router2();
/// Query all connected systems to connect through them to a third system.
/// System will return ID_ROUTER_2_FORWARDING_NO_PATH if unable to connect.
/// Else you will get ID_CONNECTION_REQUEST_ACCEPTED with Packet::guid equal to endpointGuid
/// \note The SystemAddress for a connection should not be used - always use RakNetGuid as the address can change at any time.
/// When the address changes, you will get ID_ROUTER_2_REROUTED
void Connect(RakNetGUID endpointGuid);
/// Set the maximum number of bidirectional connections this system will support
/// Defaults to 0
void SetMaximumForwardingRequests(int max);
// --------------------------------------------------------------------------------------------
// Packet handling functions
// --------------------------------------------------------------------------------------------
virtual PluginReceiveResult OnReceive(Packet *packet);
virtual void Update(void);
virtual void OnClosedConnection(SystemAddress systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason );
virtual void OnFailedConnectionAttempt(SystemAddress systemAddress, PI2_FailedConnectionAttemptReason failedConnectionAttemptReason);
virtual void OnNewConnection(SystemAddress systemAddress, RakNetGUID rakNetGUID, bool isIncoming);
virtual void OnShutdown(void);
enum Router2RequestStates
{
R2RS_REQUEST_STATE_QUERY_FORWARDING,
REQUEST_STATE_REQUEST_FORWARDING,
};
struct ConnectionRequestSystem
{
RakNetGUID guid;
int pingToEndpoint;
unsigned short usedForwardingEntries;
};
struct ConnnectRequest
{
ConnnectRequest();
~ConnnectRequest();
DataStructures::List<ConnectionRequestSystem> connectionRequestSystems;
Router2RequestStates requestState;
RakNetTimeMS pingTimeout;
RakNetGUID endpointGuid;
RakNetGUID lastRequestedForwardingSystem;
bool returnConnectionLostOnFailure;
unsigned int GetGuidIndex(RakNetGUID guid);
};
unsigned int GetConnectionRequestIndex(RakNetGUID endpointGuid);
struct MiniPunchRequest
{
RakNetGUID endpointGuid;
SystemAddress endpointAddress;
bool gotReplyFromEndpoint;
RakNetGUID sourceGuid;
SystemAddress sourceAddress;
bool gotReplyFromSource;
RakNetTimeMS timeout;
RakNetTimeMS nextAction;
unsigned short srcToDestPort;
unsigned short destToSourcePort;
SOCKET srcToDestSocket;
SOCKET destToSourceSocket;
};
struct ForwardedConnection
{
RakNetGUID endpointGuid;
RakNetGUID intermediaryGuid;
SystemAddress intermediaryAddress;
bool returnConnectionLostOnFailure;
};
protected:
bool UpdateForwarding(unsigned int connectionRequestIndex);
void RemoveConnectionRequest(unsigned int connectionRequestIndex);
void RequestForwarding(unsigned int connectionRequestIndex);
void OnQueryForwarding(Packet *packet);
void OnQueryForwardingReply(Packet *packet);
void OnRequestForwarding(Packet *packet);
void OnMiniPunchReply(Packet *packet);
void OnForwardingSuccess(Packet *packet);
int GetLargestPingAmongConnectedSystems(void) const;
void ReturnToUser(MessageID messageId, RakNetGUID endpointGuid, SystemAddress systemAddress);
bool ConnectInternal(RakNetGUID endpointGuid, bool returnConnectionLostOnFailure);
UDPForwarder *udpForwarder;
int maximumForwardingRequests;
DataStructures::List<ConnnectRequest*> connectionRequests;
DataStructures::List<MiniPunchRequest> miniPunchesInProgress;
DataStructures::List<ForwardedConnection> forwardedConnectionList;
void ClearConnectionRequests(void);
void ClearMinipunches(void);
void ClearForwardedConnections(void);
void ClearAll(void);
int ReturnFailureOnCannotForward(RakNetGUID sourceGuid, RakNetGUID endpointGuid);
void SendFailureOnCannotForward(RakNetGUID sourceGuid, RakNetGUID endpointGuid);
void SendForwardingSuccess(RakNetGUID sourceGuid, RakNetGUID endpointGuid);
void SendOOBFromRakNetPort(OutOfBandIdentifiers oob, BitStream *extraData, SystemAddress sa);
void SendOOBFromSpecifiedSocket(OutOfBandIdentifiers oob, SystemAddress sa, SOCKET socket);
void SendOOBMessages(MiniPunchRequest *mpr);
};
}
#endif
| [
"[email protected]"
] | [
[
[
1,
146
]
]
] |
ad0bf2bbdbff53d2b0b8a39b01302b4d6978da6b | 3e69b159d352a57a48bc483cb8ca802b49679d65 | /tags/release-2005-12-22/eeschema/save_schemas.cpp | 12dae49cb2c5ba92d18509e44beb3570d351a310 | [] | no_license | BackupTheBerlios/kicad-svn | 4b79bc0af39d6e5cb0f07556eb781a83e8a464b9 | 4c97bbde4b1b12ec5616a57c17298c77a9790398 | refs/heads/master | 2021-01-01T19:38:40.000652 | 2006-06-19T20:01:24 | 2006-06-19T20:01:24 | 40,799,911 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,747 | cpp | /*********************************************/
/* eesave.cpp Module to Save EESchema files */
/*********************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "program.h"
#include "libcmp.h"
#include "general.h"
#include "macros.h"
#include "protos.h"
/* Format des fichiers: Voir EELOAD.CC */
/* Fonctions externes */
/* Fonctions Locales */
static int SavePartDescr( FILE *f, EDA_SchComponentStruct * LibItemStruct);
static int SaveSheetDescr( FILE *f, DrawSheetStruct * SheetStruct);
static void SaveLayers(FILE *f);
/* Variables locales */
/*****************************************************************************
* Routine to save an EESchema file. *
* FileSave controls how the file is to be saved - under what name. *
* Returns TRUE if the file has been saved. *
*****************************************************************************/
bool WinEDA_SchematicFrame::SaveEEFile(BASE_SCREEN *Window, int FileSave)
{
wxString msg;
wxString Name, BakName;
const wxChar **LibNames;
char * layer, *width;
int ii, shape;
bool Failed = FALSE;
EDA_BaseStruct *Phead;
W_PLOT * PlotSheet;
FILE *f;
wxString dirbuf;
if ( Window == NULL ) Window = ActiveScreen;
/* If no name exists in the window yet - save as new. */
if( Window->m_FileName.IsEmpty() ) FileSave = FILE_SAVE_NEW;
switch (FileSave)
{
case FILE_SAVE_AS:
dirbuf = wxGetCwd() + STRING_DIR_SEP;
Name = MakeFileName(dirbuf, Window->m_FileName, g_SchExtBuffer);
/* Rename the old file to a '.bak' one: */
BakName = Name;
if ( wxFileExists(Name) )
{
ChangeFileNameExt(BakName, wxT(".bak"));
wxRemoveFile(BakName); /* delete Old .bak file */
if( ! wxRenameFile(Name, BakName) )
{
DisplayError(this, wxT("Warning: unable to rename old file"), 10);
}
}
break;
case FILE_SAVE_NEW:
{
wxString mask = wxT("*") + g_SchExtBuffer;
Name = EDA_FileSelector(_("Schematic files:"),
wxEmptyString, /* Chemin par defaut */
Window->m_FileName, /* nom fichier par defaut, et resultat */
g_SchExtBuffer, /* extension par defaut */
mask, /* Masque d'affichage */
this,
wxSAVE,
FALSE
);
if ( Name.IsEmpty() ) return FALSE;
Window->m_FileName = Name;
dirbuf = wxGetCwd() + STRING_DIR_SEP;
Name = MakeFileName(dirbuf, Name, g_SchExtBuffer);
break;
}
default: break;
}
if ((f = wxFopen(Name, wxT("wt"))) == NULL)
{
msg = _("Failed to create file ") + Name;
DisplayError(this, msg);
return FALSE;
}
msg = _("Save file ") + Name;
Affiche_Message(msg);
LibNames = GetLibNames();
BakName.Empty(); // temporary buffer!
for (ii = 0; LibNames[ii] != NULL; ii++)
{
if (ii > 0) BakName += wxT(",");
BakName += LibNames[ii];
}
MyFree( LibNames);
if (fprintf(f, "%s %s %d\n", EESCHEMA_FILE_STAMP,
SCHEMATIC_HEAD_STRING, EESCHEMA_VERSION) == EOF ||
fprintf(f, "LIBS:%s\n", CONV_TO_UTF8(BakName)) == EOF)
{
DisplayError(this, _("File write operation failed."));
fclose(f);
return FALSE;
}
Window->ClrModify();
SaveLayers(f);
/* Sauvegarde des dimensions du schema, des textes du cartouche.. */
PlotSheet = Window->m_CurrentSheet;
fprintf(f,"$Descr %s %d %d\n",CONV_TO_UTF8(PlotSheet->m_Name),
PlotSheet->m_Size.x, PlotSheet->m_Size.y);
fprintf(f,"Sheet %d %d\n",Window->m_SheetNumber, Window->m_NumberOfSheet);
fprintf(f,"Title \"%s\"\n",CONV_TO_UTF8(Window->m_Title));
fprintf(f,"Date \"%s\"\n",CONV_TO_UTF8(Window->m_Date));
fprintf(f,"Rev \"%s\"\n",CONV_TO_UTF8(Window->m_Revision));
fprintf(f,"Comp \"%s\"\n",CONV_TO_UTF8(Window->m_Company));
fprintf(f,"Comment1 \"%s\"\n", CONV_TO_UTF8(Window->m_Commentaire1));
fprintf(f,"Comment2 \"%s\"\n", CONV_TO_UTF8(Window->m_Commentaire2));
fprintf(f,"Comment3 \"%s\"\n", CONV_TO_UTF8(Window->m_Commentaire3));
fprintf(f,"Comment4 \"%s\"\n", CONV_TO_UTF8(Window->m_Commentaire4));
fprintf(f,"$EndDescr\n");
/* Sauvegarde des elements du dessin */
Phead = Window->EEDrawList;
while (Phead)
{
switch(Phead->m_StructType)
{
case DRAW_LIB_ITEM_STRUCT_TYPE: /* Its a library item. */
SavePartDescr( f, (EDA_SchComponentStruct *) Phead);
break;
case DRAW_SHEET_STRUCT_TYPE: /* Its a Sheet item. */
SaveSheetDescr( f, (DrawSheetStruct *) Phead);
break;
case DRAW_SEGMENT_STRUCT_TYPE: /* Its a Segment item. */
#undef STRUCT
#define STRUCT ((EDA_DrawLineStruct *) Phead)
layer = "Notes"; width = "Line";
if (STRUCT->m_Layer == LAYER_WIRE) layer = "Wire";
if (STRUCT->m_Layer == LAYER_BUS) layer = "Bus";
if( STRUCT->m_Width != GR_NORM_WIDTH) layer = "Bus";
if (fprintf(f, "Wire %s %s\n", layer, width ) == EOF)
{
Failed = TRUE; break;
}
if (fprintf(f, "\t%-4d %-4d %-4d %-4d\n",
STRUCT->m_Start.x,STRUCT->m_Start.y,
STRUCT->m_End.x,STRUCT->m_End.y) == EOF)
{
Failed = TRUE; break;
}
break;
case DRAW_BUSENTRY_STRUCT_TYPE: /* Its a Raccord item. */
#undef STRUCT
#define STRUCT ((DrawBusEntryStruct *) Phead)
layer = "Wire"; width = "Line";
if (STRUCT->m_Layer == LAYER_BUS)
{
layer = "Bus"; width = "Bus";
}
if (fprintf(f, "Entry %s %s\n", layer, width) == EOF)
{
Failed = TRUE; break;
}
if( fprintf(f, "\t%-4d %-4d %-4d %-4d\n",
STRUCT->m_Pos.x,STRUCT->m_Pos.y,
STRUCT->m_End().x,STRUCT->m_End().y) == EOF)
{
Failed = TRUE; break;
}
break;
case DRAW_POLYLINE_STRUCT_TYPE: /* Its a polyline item. */
#undef STRUCT
#define STRUCT ((DrawPolylineStruct *) Phead)
layer = "Notes"; width = "Line";
if (STRUCT->m_Layer == LAYER_WIRE) layer = "Wire";
if (STRUCT->m_Layer == LAYER_BUS) layer = "Bus";
if( STRUCT->m_Width != GR_NORM_WIDTH) width = "Bus";
if (fprintf(f, "Poly %s %s %d\n",
width, layer, STRUCT->m_NumOfPoints) == EOF)
{
Failed = TRUE; break;
}
for (ii = 0; ii < STRUCT->m_NumOfPoints; ii++)
{
if (fprintf(f, "\t%-4d %-4d\n",
STRUCT->m_Points[ii*2],
STRUCT->m_Points[ii*2+1]) == EOF)
{
Failed = TRUE;
break;
}
}
break;
case DRAW_JUNCTION_STRUCT_TYPE: /* Its a connection item. */
#undef STRUCT
#define STRUCT ((DrawJunctionStruct *) Phead)
if (fprintf(f, "Connection ~ %-4d %-4d\n",
STRUCT->m_Pos.x, STRUCT->m_Pos.y) == EOF)
{
Failed = TRUE;
}
break;
case DRAW_NOCONNECT_STRUCT_TYPE: /* Its a NoConnection item. */
#undef STRUCT
#define STRUCT ((DrawNoConnectStruct *) Phead)
if (fprintf(f, "NoConn ~ %-4d %-4d\n",
STRUCT->m_Pos.x, STRUCT->m_Pos.y) == EOF)
{
Failed = TRUE;
}
break;
case DRAW_TEXT_STRUCT_TYPE: /* Its a text item. */
#undef STRUCT
#define STRUCT ((DrawTextStruct *) Phead)
if (fprintf(f, "Text Notes %-4d %-4d %-4d %-4d ~\n%s\n",
STRUCT->m_Pos.x, STRUCT->m_Pos.y,
STRUCT->m_Orient, STRUCT->m_Size.x,
CONV_TO_UTF8(STRUCT->m_Text)) == EOF)
Failed = TRUE;
break;
case DRAW_LABEL_STRUCT_TYPE: /* Its a label item. */
#undef STRUCT
#define STRUCT ((DrawLabelStruct *) Phead)
shape = '~';
if (fprintf(f, "Text Label %-4d %-4d %-4d %-4d %c\n%s\n",
STRUCT->m_Pos.x, STRUCT->m_Pos.y,
STRUCT->m_Orient, STRUCT->m_Size.x, shape,
CONV_TO_UTF8(STRUCT->m_Text)) == EOF)
Failed = TRUE;
break;
case DRAW_GLOBAL_LABEL_STRUCT_TYPE: /* Its a Global label item. */
#undef STRUCT
#define STRUCT ((DrawGlobalLabelStruct *) Phead)
shape = STRUCT->m_Shape;
if (fprintf(f, "Text GLabel %-4d %-4d %-4d %-4d %s\n%s\n",
STRUCT->m_Pos.x, STRUCT->m_Pos.y,
STRUCT->m_Orient, STRUCT->m_Size.x,
SheetLabelType[shape],
CONV_TO_UTF8(STRUCT->m_Text)) == EOF)
Failed = TRUE;
break;
case DRAW_MARKER_STRUCT_TYPE: /* Its a marker item. */
#undef STRUCT
#define STRUCT ((DrawMarkerStruct *) Phead)
if( STRUCT->GetComment() ) msg = STRUCT->GetComment();
else msg.Empty();
if (fprintf(f, "Kmarq %c %-4d %-4d \"%s\" F=%X\n",
(int) STRUCT->m_Type + 'A',
STRUCT->m_Pos.x, STRUCT->m_Pos.y,
CONV_TO_UTF8(msg), STRUCT->m_MarkFlags) == EOF)
{
Failed = TRUE;
}
break;
case DRAW_SHEETLABEL_STRUCT_TYPE :
case DRAW_PICK_ITEM_STRUCT_TYPE :
break;
default:
break;
}
if (Failed)
{
DisplayError(this, _("File write operation failed."));
break;
}
Phead = Phead->Pnext;
}
if (fprintf(f, "$EndSCHEMATC\n") == EOF) Failed = TRUE;
fclose(f);
if (FileSave == FILE_SAVE_NEW) Window->m_FileName = Name;
return !Failed;
}
/*******************************************************************/
static int SavePartDescr( FILE *f, EDA_SchComponentStruct * LibItemStruct)
/*******************************************************************/
/* Routine utilisee dans la routine precedente.
Assure la sauvegarde de la structure LibItemStruct
*/
{
int ii, Failed = FALSE;
char Name1[256], Name2[256];
int hjustify, vjustify;
strcpy(Name1, CONV_TO_UTF8(LibItemStruct->m_Field[REFERENCE].m_Text));
for (ii = 0; ii < (int)strlen(Name1); ii++)
if (Name1[ii] <= ' ') Name1[ii] = '~';
if ( ! LibItemStruct->m_ChipName.IsEmpty() )
{
strcpy(Name2, CONV_TO_UTF8(LibItemStruct->m_ChipName));
for (ii = 0; ii < (int)strlen(Name2); ii++)
if (Name2[ii] <= ' ') Name2[ii] = '~';
}
else strcpy(Name2, NULL_STRING);
fprintf(f, "$Comp\n");
if(fprintf (f, "L %s %s\n", Name2, Name1) == EOF)
{
Failed = TRUE;
return(Failed);
}
/* Generation de numero d'unit, convert et Time Stamp*/
if(fprintf(f, "U %d %d %8.8lX\n",
LibItemStruct->m_Multi,
LibItemStruct->m_Convert,
LibItemStruct->m_TimeStamp) == EOF)
{
Failed = TRUE; return(Failed);
}
/* Sortie de la position */
if(fprintf(f, "P %d %d\n",
LibItemStruct->m_Pos.x, LibItemStruct->m_Pos.y) == EOF)
{
Failed = TRUE; return(Failed);
}
for( ii = 0; ii < NUMBER_OF_FIELDS; ii++ )
{
PartTextStruct * field = & LibItemStruct->m_Field[ii];
if( field->m_Text.IsEmpty() ) continue;
hjustify = 'C';
if ( field->m_HJustify == GR_TEXT_HJUSTIFY_LEFT)
hjustify = 'L';
else if ( field->m_HJustify == GR_TEXT_HJUSTIFY_RIGHT)
hjustify = 'R';
vjustify = 'C';
if ( field->m_VJustify == GR_TEXT_VJUSTIFY_BOTTOM)
vjustify = 'B';
else if ( field->m_VJustify == GR_TEXT_VJUSTIFY_TOP)
vjustify = 'T';
if( fprintf(f,"F %d \"%s\" %c %-3d %-3d %-3d %4.4X %c %c\n", ii,
CONV_TO_UTF8(field->m_Text),
field->m_Orient == TEXT_ORIENT_HORIZ ? 'H' : 'V',
field->m_Pos.x, field->m_Pos.y,
field->m_Size.x,
field->m_Attributs,
hjustify, vjustify) == EOF)
{
Failed = TRUE; break;
}
}
if (Failed) return(Failed);
/* Generation du num unit, position, box ( ancienne norme )*/
if(fprintf(f, "\t%-4d %-4d %-4d\n",
LibItemStruct->m_Multi,
LibItemStruct->m_Pos.x, LibItemStruct->m_Pos.y) == EOF)
{
Failed = TRUE; return(Failed);
}
if( fprintf(f, "\t%-4d %-4d %-4d %-4d\n",
LibItemStruct->m_Transform[0][0],
LibItemStruct->m_Transform[0][1],
LibItemStruct->m_Transform[1][0],
LibItemStruct->m_Transform[1][1]) == EOF)
{
Failed = TRUE; return(Failed);
}
fprintf(f, "$EndComp\n");
return(Failed);
}
/*******************************************************************/
/* static int SaveSheetDescr( FILE *f, DrawSheetStruct * SheetStruct) */
/*******************************************************************/
/* Routine utilisee dans la routine precedente.
Assure la sauvegarde de la structure LibItemStruct
*/
static int SaveSheetDescr( FILE *f, DrawSheetStruct * SheetStruct)
{
int ii;
int Failed = FALSE;
DrawSheetLabelStruct * SheetLabel;
fprintf(f, "$Sheet\n");
if (fprintf(f, "S %-4d %-4d %-4d %-4d\n",
SheetStruct->m_Pos.x,SheetStruct->m_Pos.y,
SheetStruct->m_End.x,SheetStruct->m_End.y) == EOF)
{
Failed = TRUE; return(Failed);
}
/* Generation de la liste des 2 textes (sheetname et filename) */
if ( ! SheetStruct->m_Field[VALUE].m_Text.IsEmpty())
{
if(fprintf(f,"F0 \"%s\" %d\n", CONV_TO_UTF8(SheetStruct->m_Field[VALUE].m_Text),
SheetStruct->m_Field[VALUE].m_Size.x) == EOF)
{
Failed = TRUE; return(Failed);
}
}
if( ! SheetStruct->m_Field[SHEET_FILENAME].m_Text.IsEmpty())
{
if(fprintf(f,"F1 \"%s\" %d\n",
CONV_TO_UTF8(SheetStruct->m_Field[SHEET_FILENAME].m_Text),
SheetStruct->m_Field[SHEET_FILENAME].m_Size.x) == EOF)
{
Failed = TRUE; return(Failed);
}
}
/* Generation de la liste des labels (entrees) de la sous feuille */
ii = 2;
SheetLabel = SheetStruct->m_Label;
while( SheetLabel != NULL )
{
int type = 'U', side = 'L';
if( SheetLabel->m_Text.IsEmpty() ) continue;
if( SheetLabel->m_Edge ) side = 'R';
switch(SheetLabel->m_Shape)
{
case NET_INPUT: type = 'I'; break;
case NET_OUTPUT: type = 'O'; break;
case NET_BIDI: type = 'B'; break;
case NET_TRISTATE: type = 'T'; break;
case NET_UNSPECIFIED: type = 'U'; break;
}
if(fprintf(f,"F%d \"%s\" %c %c %-3d %-3d %-3d\n", ii,
CONV_TO_UTF8(SheetLabel->m_Text), type, side,
SheetLabel->m_Pos.x, SheetLabel->m_Pos.y,
SheetLabel->m_Size.x) == EOF)
{
Failed = TRUE; break;
}
ii++;
SheetLabel = (DrawSheetLabelStruct*)SheetLabel->Pnext;
}
fprintf(f, "$EndSheet\n");
return(Failed);
}
/****************************/
/* void SaveLayers(FILE *f) */
/****************************/
/* Save a Layer Structure to a file */
static void SaveLayers(FILE *f)
{
fprintf(f,"EELAYER %2d %2d\n", g_LayerDescr.NumberOfLayers,g_LayerDescr.CurrentLayer);
fprintf(f,"EELAYER END\n");
}
| [
"bokeoa@244deca0-f506-0410-ab94-f4f3571dea26"
] | [
[
[
1,
497
]
]
] |
c510dd652d4808ed8396acb22a239c274a01ba56 | ce148b48b453a58d84664ec979eb64e4813a83c8 | /Faeried/FaerieAnimation.cpp | 6535157ef331dd2909143c6ae1cc0618cd6ea120 | [] | no_license | theyoprst/Faeried | e8945f8cb21c317eeeb1b05f0d12b297b63621fe | d20bd990e7f91c8c03857d81e08b8f7f2dee3541 | refs/heads/master | 2020-04-09T16:04:47.472907 | 2011-02-21T16:38:02 | 2011-02-21T16:38:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,993 | cpp | #include "FaerieAnimation.h"
FaerieAnimation::FaerieAnimation(Xml::Node* element)
{
_name = Xml::GetStringAttribute(element, "name");
_time = Xml::GetFloatAttribute(element, "time");
Xml::Node* keyFrameXml = element->first_node("keyFrame");
while (keyFrameXml != NULL) {
_keyFrames.push_back(FaerieFrame(keyFrameXml));
keyFrameXml = keyFrameXml->next_sibling("keyFrame");
}
CreateAnimationSplines();
}
FaerieAnimation::FaerieAnimation(std::string name)
: _name(name)
, _time(5.0f)
{
_keyFrames.push_back(FaerieFrame());
CreateAnimationSplines();
}
FaerieFrame FaerieAnimation::GetFrame(float t) {
float time = fmod(t, _time);
time /= _time;
FaerieFrame::BonesDegrees bonesDegrees;
for (AngleSplines::iterator i = _angleSplines.begin(); i != _angleSplines.end(); ++i) {
bonesDegrees[i->first] = i->second.getGlobalFrame(time);
}
FPoint shift(_xSpline.getGlobalFrame(time), _ySpline.getGlobalFrame(time));
return FaerieFrame(bonesDegrees, shift);
}
void FaerieAnimation::FillXml(Xml::Document* document, Xml::Node* element) {
Xml::SetStringAttribute(document, element, "name", _name);
Xml::SetFloatAttribute(document, element, "time", _time);
for (KeyFrames::iterator i = _keyFrames.begin(); i != _keyFrames.end(); ++i) {
i->FillXml(document, Xml::AddElement(document, element, "keyFrame"));
}
}
void FaerieAnimation::AddFrameToSpline(size_t frameNumber, const FaerieFrame& frame) {
float time = static_cast<float>(frameNumber) / _keyFrames.size();
const FaerieFrame::BonesDegrees& degrees = frame.GetBonesDegrees();
for (FaerieFrame::BonesDegrees::const_iterator bone = degrees.begin(); bone != degrees.end(); ++bone) {
_angleSplines[bone->first].addKey(time, bone->second);
}
FPoint shift = frame.GetShift();
_xSpline.addKey(time, shift.x);
_ySpline.addKey(time, shift.y);
}
void FaerieAnimation::CreateAnimationSplines() {
int frameNumber = 0;
_angleSplines.clear();
_xSpline.clear();
_ySpline.clear();
assert(_keyFrames.size() > 0);
for (KeyFrames::iterator i = _keyFrames.begin(); i != _keyFrames.end(); ++i) {
AddFrameToSpline(frameNumber, *i);
++frameNumber;
}
AddFrameToSpline(_keyFrames.size(), _keyFrames.front());
// Calculate Gradients
for (AngleSplines::iterator i = _angleSplines.begin(); i != _angleSplines.end(); ++i) {
i->second.CalculateGradient();
}
_xSpline.CalculateGradient();
_ySpline.CalculateGradient();
}
std::string FaerieAnimation::GetName() {
return _name;
}
float FaerieAnimation::GetTime() {
return _time;
}
void FaerieAnimation::SetTime(float time) {
assert(time > 0.0f);
_time = time;
}
int FaerieAnimation::GetFramesNumber() {
return static_cast<int>(_keyFrames.size());
}
void FaerieAnimation::CloneFrame(int frameNumber) {
assert(0 <= frameNumber && frameNumber < static_cast<int>(_keyFrames.size()));
KeyFrames::iterator frame = _keyFrames.begin();
std::advance(frame, frameNumber);
KeyFrames::iterator frameNext = frame;
std::advance(frameNext, 1);
_keyFrames.insert(frameNext, *frame);
CreateAnimationSplines();
}
void FaerieAnimation::DeleteFrame(int frameNumber) {
assert(0 <= frameNumber && frameNumber < static_cast<int>(_keyFrames.size()));
KeyFrames::iterator frame = _keyFrames.begin();
std::advance(frame, frameNumber);
_keyFrames.erase(frame);
CreateAnimationSplines();
}
FaerieFrame FaerieAnimation::GetKeyFrame(int frameNumber) {
assert(0 <= frameNumber && frameNumber < static_cast<int>(_keyFrames.size()));
KeyFrames::iterator frame = _keyFrames.begin();
std::advance(frame, frameNumber);
assert(frame != _keyFrames.end());
return *frame;
}
void FaerieAnimation::SetKeyFrame(int frameNumber, FaerieFrame frame) {
assert(0 <= frameNumber && frameNumber < static_cast<int>(_keyFrames.size()));
KeyFrames::iterator iFrame = _keyFrames.begin();
std::advance(iFrame, frameNumber);
*iFrame = frame;
CreateAnimationSplines();
}
| [
"[email protected]"
] | [
[
[
1,
122
]
]
] |
0f21594bf0caaf2e881970801587ca24b4371e11 | bd205edfb0877a4177793012ac0cdbac7b88106a | /vs/SampleApp/skia_win.cpp | dd02bdbc6896486b7c6d041a63947329a621be79 | [] | no_license | rburchell/skia | 5916d995a88677540c774e74d88005ca22c24e6b | 7530425f0ef6e39a0ee666daaff0c18029fee5dd | HEAD | 2016-09-05T18:35:09.456792 | 2010-11-12T19:52:38 | 2010-11-12T23:43:37 | 1,045,866 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 4,867 | cpp | // SampleApp.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "SampleApp.h"
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hInst; // current instance
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name
// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_SAMPLEAPP, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SAMPLEAPP));
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
// COMMENTS:
//
// This function and its usage are only necessary if you want this code
// to be compatible with Win32 systems prior to the 'RegisterClassEx'
// function that was added to Windows 95. It is important to call this function
// so that the application will get 'well formed' small icons associated
// with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SAMPLEAPP));
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = MAKEINTRESOURCE(IDC_SAMPLEAPP);
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
return RegisterClassEx(&wcex);
}
#include "SkOSWindow_Win.h"
extern SkOSWindow* create_sk_window(void* hwnd);
static SkOSWindow* gSkWind;
//
// FUNCTION: InitInstance(HINSTANCE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
hInst = hInstance; // Store instance handle in our global variable
hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
if (!hWnd)
{
return FALSE;
}
gSkWind = create_sk_window(hWnd);
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
//
// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) {
case WM_COMMAND: {
int wmId = LOWORD(wParam);
int wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId) {
case IDM_ABOUT:
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
} break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
if (gSkWind->wndProc(hWnd, message, wParam, lParam)) {
return 0;
} else {
return DefWindowProc(hWnd, message, wParam, lParam);
}
}
return 0;
}
// Message handler for about box.
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
switch (message)
{
case WM_INITDIALOG:
return (INT_PTR)TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
}
break;
}
return (INT_PTR)FALSE;
}
| [
"[email protected]@107f31f1-e31d-0410-a17c-a9b5b17689e2"
] | [
[
[
1,
190
]
]
] |
06adfbbaec9aef29536163e35935921ee6c312ce | 4d5ee0b6f7be0c3841c050ed1dda88ec128ae7b4 | /src/nvmesh/subdiv/StencilMask.h | 2c81322d4e5818f3347efd4a35ebe38e5a71b695 | [] | no_license | saggita/nvidia-mesh-tools | 9df27d41b65b9742a9d45dc67af5f6835709f0c2 | a9b7fdd808e6719be88520e14bc60d58ea57e0bd | refs/heads/master | 2020-12-24T21:37:11.053752 | 2010-09-03T01:39:02 | 2010-09-03T01:39:02 | 56,893,300 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,223 | h | // Copyright NVIDIA Corporation 2006 -- Ignacio Castano <[email protected]>
#ifndef NV_MESH_STENCILMASK_H
#define NV_MESH_STENCILMASK_H
#include <nvcore/Containers.h>
namespace nv
{
class StencilMask
{
public:
StencilMask();
explicit StencilMask(uint size);
StencilMask(const StencilMask & mask);
void resize(uint size);
StencilMask & operator = (const StencilMask & mask);
StencilMask & operator = (float value);
void operator += (const StencilMask & mask);
void operator -= (const StencilMask & mask);
void operator *= (float scale);
void operator /= (float scale);
bool operator == (const StencilMask & other) const;
bool operator != (const StencilMask & other) const;
uint count() const { return m_weightArray.count(); }
float operator[] (uint i) const { return m_weightArray[i]; }
float & operator[] (uint i) { return m_weightArray[i]; }
float sum() const;
bool isNormalized() const;
void normalize();
friend void swap(StencilMask & a, StencilMask & b)
{
swap(a.m_weightArray, b.m_weightArray);
}
private:
Array<float> m_weightArray;
};
} // nv namespace
#endif // NV_MESH_STENCILMASK_H
| [
"castano@0f2971b0-9fc2-11dd-b4aa-53559073bf4c"
] | [
[
[
1,
53
]
]
] |
e80a01e8a0c33428f8b585807bba020af1ad69db | 64d7fa49d314ce17ffb7f7610a8f290656b27459 | /Dogfight/main.cpp | 319e03d6e61233c6cd399a3e701262f9d8a716fc | [] | no_license | DavidVondras/dogfight2d | 7aa684cb2e53c1a56eeb2c3ce132010b1c920259 | 8853878ba05440d1a091cb8eb772dc75aad9e87c | refs/heads/master | 2020-06-08T06:54:04.541288 | 2010-06-22T12:23:44 | 2010-06-22T12:23:44 | 41,377,872 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 490 | cpp | #include <stdlib.h>
#include <iostream>
#include "SceneManager.h"
// Declarations
void EndStepMethod(void);
///
/// Main method
///
int main(void)
{
SceneManager sceneManager;
sceneManager.SetStepEndMethod(EndStepMethod);
//Main loop
do
{
sceneManager.Step();
}
while(!sceneManager.GetEventListener()->GetInputClose());
return EXIT_SUCCESS;
}
///
/// Method invoked at the endInvoke of the step method
///
void EndStepMethod(void)
{
} | [
"charles.hetier@5302af2b-d63e-2d39-01d7-87716617f583"
] | [
[
[
1,
36
]
]
] |
82d213b024c92dde1fe05926162d1be153c9770f | 0f457762985248f4f6f06e29429955b3fd2c969a | /irrlicht/sdk/irr_bullet/CBulletObjectAnimator.h | 8aca1ec9010e0ff778c0235c50b66b149267e4dc | [] | no_license | tk8812/ukgtut | f19e14449c7e75a0aca89d194caedb9a6769bb2e | 3146ac405794777e779c2bbb0b735b0acd9a3f1e | refs/heads/master | 2021-01-01T16:55:07.417628 | 2010-11-15T16:02:53 | 2010-11-15T16:02:53 | 37,515,002 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 8,156 | h | // A game application wrapper class
#ifndef __C_SCENE_NODE_ANIMATOR_BULLET_OBJECT_H_INCLUDED__
#define __C_SCENE_NODE_ANIMATOR_BULLET_OBJECT_H_INCLUDED__
//! Bullet
#include "LinearMath/btVector3.h"
#include "LinearMath/btMatrix3x3.h"
#include "LinearMath/btTransform.h"
#include "LinearMath/btQuickprof.h"
#include "LinearMath/btAlignedObjectArray.h"
class btConstraintSolver;
class btCollisionDispatcher;
class btDynamicsWorld;
class btTypedConstraint;
class btTriangleIndexVertexArray;
class btStridingMeshInterface;
class btCollisionShape;
class btRigidBody;
class btCollisionObject;
struct btDefaultMotionState;
//! Irrlicht
#include "irrlicht.h"
#include "CBulletPhysicsUtils.h"
namespace irr
{
namespace scene
{
class CBulletAnimatorManager;
//------------------------------------------------------------------------------
//! CBulletObjectAnimatorGeometryTypes
//! All available bullet's geometry types
enum CBulletObjectAnimatorGeometryTypes
{
CBPAGT_NONE = 0,
CBPAGT_SPHERE,
CBPAGT_BOX,
CBPAGT_CYLINDER,
CBPAGT_CAPSULE,
CBPAGT_CONE,
CBPAGT_STATIC_PLANE,
CBPAGT_CONVEX_MESH,
CBPAGT_CONCAVE_MESH,
CBPAGT_CONCAVE_GIMPACT_MESH,
//! gbox patch
CBPAGT_CONCAVE_LOD_TERRAIN_MESH,
/////////////////
//! This enum is never used, it only forces the compiler to
//! compile these enumeration values to 32 bit.
CBPAGT_FORCE_32_BIT = 0x7fffffff
};
//------------------------------------------------------------------------------
//! Helper structure to configure animator geometry
struct CBulletObjectAnimatorGeometry
{
CBulletObjectAnimatorGeometry()
{ type = CBPAGT_NONE; mesh.irrMesh = NULL; }
CBulletObjectAnimatorGeometry(const CBulletObjectAnimatorGeometry& obj)
{ type = obj.type; meshFile = obj.meshFile; sphere = obj.sphere; box = obj.box; mesh = obj.mesh; }
CBulletObjectAnimatorGeometryTypes type;
union
{
struct CSphereGeom
{
f32 radius; //! sphere radius
} sphere;
struct CBoxGeom
{
f32 X, Y, Z; //! boxHalfExtents
} box;
struct CCapsuleGeom
{
f32 radius; //! capsule radius
f32 hight; //!capsule hight
} Capsule;
struct CMesh
{
IMesh* irrMesh; //! mesh interface
} mesh;
struct CTerrainMesh
{
//ITerrainSceneNode *pTerrain;
s32 meshLod;
} terrain_mesh;
};
core::stringc meshFile; //! mesh file
};
//------------------------------------------------------------------------------
//! Helper structure to configure animator physics parameters
struct CBulletObjectAnimatorParams
{
CBulletObjectAnimatorParams() : mass(1.0f), ccdThreshold(0.0f),
linearDamping(0.0f), angularDamping(0.0f), friction(0.5f),
restitution(0.0f), centerOfMassOffset(), gravity(0, 0, 0) {}
f32 mass;
f32 ccdThreshold;
f32 linearDamping;
f32 angularDamping;
f32 friction;
f32 restitution;
core::vector3df gravity;
core::vector3df centerOfMassOffset;
};
//------------------------------------------------------------------------------
//! CBulletObjectAnimator
/** Performs synchronization task between Bullet's object and corresponding
* scene node, also applies external forces to Bullet's object
*/
class CBulletObjectAnimator : public ISceneNodeAnimator
{
public:
//! CreateInstance
static CBulletObjectAnimator* createInstance(
ISceneManager* pSceneManager,
ISceneNode* pSceneNode,
CBulletAnimatorManager* pBulletMgr,
CBulletObjectAnimatorGeometry* pGeom,
CBulletObjectAnimatorParams* pPhysicsParam
);
//! CreateEmptyInstance
static CBulletObjectAnimator* createEmptyInstance(
ISceneManager* pSceneManager,
ISceneNode* pSceneNode,
CBulletAnimatorManager* pBulletMgr
);
//! Dtor
virtual ~CBulletObjectAnimator();
virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0)
{
return 0; // to be implemented by derived classes.
}
virtual void AddToWorld(s32 worldID);
void RemoveFromWorld();
//! Various setters/getters
void setPosition(const core::vector3df& v = core::vector3df(0,0,0)) const;
void setRotation(const core::vector3df& v = core::vector3df(0,0,0)) const;
core::vector3df getRotation() const;
core::vector3df getPosition() const;
void setLinearVelocity(const core::vector3df& vel = core::vector3df(0,0,0)) const;
void setAngularVelocity(const core::vector3df& vel = core::vector3df(0,0,0)) const;
core::vector3df getAngularVelocity() const;
core::vector3df getLinearVelocity() const;
void applyImpulse(const core::vector3df& impulse,
const core::vector3df& rel_pos = core::vector3df(0,0,0)) const;
void applyForce(const core::vector3df& force,
const core::vector3df& rel_pos = core::vector3df(0,0,0)) const;
void zeroForces() const;
void setActivationState(bool active) const;
void activate(bool force = false) const;
//! get internal rigid body object
inline btRigidBody* getRigidBody()
{
return rigidBody;
}
//! get internal scene node object
inline ISceneNode* const getSceneNode()
{
return sceneNode;
}
//! 인자로 넘겨준 바디가 내 바디인지 검사
inline bool isMyBody(void *co)
{
if(rigidBody == co)
return true;
return false;
//r//eturn sceneNode;
}
//! 인자로 넘겨준 바디쌍중에서 내 바디를 반환 없으면 NULL
inline btRigidBody *selectMyBody(void *co1,void *co2)
{
if(rigidBody == co1 || rigidBody == co2)
return rigidBody;
return NULL;
//r//eturn sceneNode;
}
//!가시화 오브잭트와 물리객체간의 중심점차 재정의
inline void setLocalPosition(irr::core::vector3df pos)
{
m_LocalPos = pos;
}
//ccd관련
//!ccd설정
void setCCD(btScalar ccdThreshold,btScalar CcdSweptSphereRadius);
static const c8* const *getGeometryTypesNames();
///////////////////////
protected:
//! Ctor
CBulletObjectAnimator();
//!
void InitPhysics();
//! Initialize empty animator
bool InitEmptyInstance();
//!
static btCollisionShape* CreateBulletCollisionShape(ISceneManager* pSceneManager,
CBulletObjectAnimatorGeometry* pGeom,
const core::vector3df& pScaling,
btStridingMeshInterface*& triangleMesh);
static IMesh* GetMeshFromGeom(ISceneManager* pSceneManager,
CBulletObjectAnimatorGeometry* pGeom);
//! Helper function for irrlicht mesh data serialization
void SerializeIrrMesh(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0);
void DeserializeIrrMesh(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
//! animates a scene node
virtual void animateNode(ISceneNode* node, u32 timeMs);
//! Writes attributes of the scene node animator.
void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0);
//! Reads attributes of the scene node animator.
void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
//! Returns type of the scene node animator
ESCENE_NODE_ANIMATOR_TYPE getType() const;
ISceneManager* sceneManager;
ISceneNode* sceneNode;
CBulletObjectAnimatorGeometry geometry;
CBulletObjectAnimatorParams physicsParams;
btRigidBody* rigidBody;
btDefaultMotionState* motionState;
btStridingMeshInterface* bulletMesh;
btCollisionShape* collisionShape;
CBulletAnimatorManager* bulletMgr;
s32 bulletWorldID;
irr::core::vector3df m_LocalPos;
};
} // end namespace scene
} // end namespace irr
#endif //__C_SCENE_NODE_ANIMATOR_BULLET_OBJECT_H_INCLUDED__
| [
"gbox3d@58f0f68e-7603-11de-abb5-1d1887d8974b"
] | [
[
[
1,
285
]
]
] |
f3585f1ea18b14bd4bf92a4d972c16c9840de62e | 54f826d123059fb57d8eb27d1b00cfb0cdb139e3 | /UThread++/UScheduler.h | 240ae9b3c6242099bc47020a5ddef302895cd86b | [] | no_license | duarten/UThreadPlusPlus | dc378846e7bb6156916d1e398c7106ab4d64734a | f59c5530d1470c8a72e35edb2466ded4c346c1b9 | refs/heads/master | 2020-06-14T16:52:01.346981 | 2011-04-11T23:09:20 | 2011-04-11T23:09:20 | 1,601,592 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,778 | h | ///////////////////////////////////////////////////////////
//
// CCISEL
// 2007-2010
//
// UThread library:
// User threads supporting cooperative multithreading.
// The current version of the library provides:
// - Threads
// - Mutexes
// - Semaphores
//
// Authors: Carlos Martins, Joao Trindade, Duarte Nunes
//
//
#pragma once
#include <list>
using namespace std;
class UThread;
//
// The singleton user threads scheduler.
//
class UScheduler
{
//
// The number of existing user threads.
//
static int m_numThreads;
//
// The currently running thread.
//
static UThread *m_pRunningThread;
//
// The list of schedulable user threads.
// The next thread to run is retrieved from the head of the list.
//
static list<UThread *> m_readyQueue;
//
// The user thread proxy of the main operating system thread. This thread
// is switched back in when there are no more runnable user threads and the
// scheduler will exit.
//
static UThread *m_pMainThread;
public:
//
// Initializes the scheduler. The operating system thread that calls the
// function switches to a user thread and resumes execution only when all
// user threads have exited.
//
static void Run();
private:
//
// Private constructor.
//
UScheduler();
//
// Returns and removes the first user thread in the ready queue.
// If the ready queue is empty, the main thread is returned.
//
static UThread * find_next_thread();
//
// UThread instances can access the USchedulers's private state.
//
friend class UThread;
};
| [
"[email protected]"
] | [
[
[
1,
87
]
]
] |
aa65bb4d3e220a75ab25342f38b9aa6c7f19b35d | 38926bfe477f933a307f51376dd3c356e7893ffc | /Source/SDKs/STLPORT/stlport/stl/_string_io.h | b55160219ec0fc35f5dbfedfd9016117ed0da149 | [
"LicenseRef-scancode-stlport-4.5"
] | permissive | richmondx/dead6 | b0e9dd94a0ebb297c0c6e9c4f24c6482ef4d5161 | 955f76f35d94ed5f991871407f3d3ad83f06a530 | refs/heads/master | 2021-12-05T14:32:01.782047 | 2008-01-01T13:13:39 | 2008-01-01T13:13:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,462 | h | /*
* Copyright (c) 1997-1999
* Silicon Graphics Computer Systems, Inc.
*
* Copyright (c) 1999
* Boris Fomitchev
*
* This material is provided "as is", with absolutely no warranty expressed
* or implied. Any use is at your own risk.
*
* Permission to use or copy this software for any purpose is hereby granted
* without fee, provided the above notices are retained on all copies.
* Permission to modify the code and to distribute modified code is granted,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*
*/
#ifndef _STLP_STRING_IO_H
#define _STLP_STRING_IO_H
#ifndef _STLP_INTERNAL_OSTREAM_H
# include <stl/_ostream.h>
#endif
#ifndef _STLP_INTERNAL_ISTREAM_H
# include <stl/_istream.h>
#endif
// I/O.
_STLP_BEGIN_NAMESPACE
template <class _CharT, class _Traits, class _Alloc>
basic_ostream<_CharT, _Traits>& _STLP_CALL
operator<<(basic_ostream<_CharT, _Traits>& __os,
const basic_string<_CharT,_Traits,_Alloc>& __s);
#if defined (_STLP_USE_TEMPLATE_EXPRESSION)
template <class _CharT, class _Traits, class _Alloc, class _Left, class _Right, class _StorageDir>
basic_ostream<_CharT, _Traits>& _STLP_CALL
operator<<(basic_ostream<_CharT, _Traits>& __os,
const __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __sum) {
basic_string<_CharT, _Traits, _Alloc> __tmp(__sum);
return __os << __tmp;
}
#endif /* _STLP_USE_TEMPLATE_EXPRESSION */
template <class _CharT, class _Traits, class _Alloc>
basic_istream<_CharT, _Traits>& _STLP_CALL
operator>>(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT,_Traits,_Alloc>& __s);
template <class _CharT, class _Traits, class _Alloc>
basic_istream<_CharT, _Traits>& _STLP_CALL
getline(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT,_Traits,_Alloc>& __s,
_CharT __delim);
#if !(defined (__BORLANDC__) && !defined (_STLP_USE_OWN_NAMESPACE))
template <class _CharT, class _Traits, class _Alloc>
inline basic_istream<_CharT, _Traits>& _STLP_CALL
getline(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT,_Traits,_Alloc>& __s) {
return getline(__is, __s, __is.widen('\n'));
}
#endif
_STLP_END_NAMESPACE
#if !defined (_STLP_LINK_TIME_INSTANTIATION)
# include <stl/_string_io.c>
#endif
#endif /* _STLP_STRING_IO_H */
| [
"[email protected]"
] | [
[
[
1,
77
]
]
] |
69b8bb97dcdcc618143a35308536af38c216b2c5 | 6b75de27b75015e5622bfcedbee0bf65e1c6755d | /stack/迷宫/labyrinth2.cpp | acdc6d55da13d4950d6b6b5f7242a2929d13d966 | [] | no_license | xhbang/data_structure | 6e4ac9170715c0e45b78f8a1b66c838f4031a638 | df2ff9994c2d7969788f53d90291608ac5b1ef2b | refs/heads/master | 2020-04-04T02:07:18.620014 | 2011-12-05T09:39:34 | 2011-12-05T09:39:34 | 2,393,408 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 2,990 | cpp | #include <iostream>
#include <stack>
#include <list>
#include <assert.h>
#include <fstream>
using namespace std;
struct Position{ //定义位置结构体
int r;
int c;
};
bool FindPath(Position start,Position end,stack<Position>& pos,int **maze)
{
Position current = start;
//定义探寻的四个方向
Position offset[4];
offset[0].r=-1; offset[0].c=0; //up
offset[1].r=0; offset[1].c=1; //right
offset[2].r=1; offset[2].c=0; //down
offset[3].r=0; offset[3].c=-1; //left
int di=0;
int lastDi=3;
int row,col;
while(current.c!=end.c || current.r!=end.r)//没有找到出口
{
while(di<=lastDi) //从当前位置按顺时针顺序探寻
{
row = current.r+offset[di].r;
col = current.c+offset[di].c;
if (maze[row][col] == 0)//下一个位置可行
{
break;
}
di++;
}
//find a througth path
if (di <= lastDi)//找到下一个可行的位置
{
pos.push(current);//将当前位置入栈
current.r = row;
current.c = col;
maze[row][col] = 1;//标记当前位置为不可通过,以免陷入死循环
di = 0;
}
else//没有找到相邻的通行线路
{
if (pos.empty())//没有找到通路
{
return false;
}
Position next;
next= pos.top();
pos.pop();
if (next.c = current.c)//取得当前应探寻的方向
{
if ( next.r>current.r )
{
di = 1;
}
else
di = 3;
}
else if (next.r = current.r)
{
di = 3 + next.c-current.c;
}
current = next;//标记当前位置为栈顶位置
}
}
pos.push(end);//将出口入栈
return true;
}
int main()
{
ifstream in("maze.dat");//定义迷宫文件
assert(in);
int row,col;
int i,j;
in>>row>>col;//读入迷宫的行和列
//定义迷宫数组,迷宫四周加墙,以使迷宫边界与内部节点同等处理
int **maze=new int*[row+2];
for (i=0; i<row+2; i++)
{
maze[i] =new int[col+2];
}
for (i=0;i<row+2;i++)//迷宫四周为墙,设置为不可通过
{
maze[i][0] = maze[i][col+1] = 1;
}
for (j=0;j<col+2;j++)
{
maze[0][j] = maze[row+1][j] = 1;
}
Position start,end;
in>>i>>j; //读入入口位置
start.r=i; start.c=j;
in>>i>>j; //读入出口位置
end.r=i; end.c=j;
//读入迷宫数据
for (i=1;i<row+1;i++)
{
for (j=1;j<col+1;j++)
{
in>>maze[i][j];
}
}
stack<Position> path;
list<Position> show;
if (FindPath(start,end,path,maze))//找到一条路径
{
while (!path.empty())
{
show.push_front(path.top());//路径出栈
path.pop();
}
list<Position>::iterator it=show.begin();
for (; it!=show.end(); it++)//显示路径
{
cout<<"("<<(*it).r<<" , "<<(*it).c<<")"<<endl;
}
}
else//没有找到路径
{
cout<<"Not find any correct path!"<<endl;
}
for (i=0; i<row+2; i++)//释放内存空间
{
delete []maze[i];
}
delete []maze;
return 0;
} | [
"[email protected]"
] | [
[
[
1,
150
]
]
] |
a86bb04c082031ea42701be5d6333b8184d0f31d | c95a83e1a741b8c0eb810dd018d91060e5872dd8 | /Game/ClientShellDLL/ClientShellShared/MarkSFX.cpp | a90921ca498e38e4e931db2eebe875bd465904c5 | [] | no_license | rickyharis39/nolf2 | ba0b56e2abb076e60d97fc7a2a8ee7be4394266c | 0da0603dc961e73ac734ff365bfbfb8abb9b9b04 | refs/heads/master | 2021-01-01T17:21:00.678517 | 2011-07-23T12:11:19 | 2011-07-23T12:11:19 | 38,495,312 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,895 | cpp | // ----------------------------------------------------------------------- //
//
// MODULE : MarkSFX.cpp
//
// PURPOSE : Mark special FX - Implementation
//
// CREATED : 10/13/97
//
// ----------------------------------------------------------------------- //
#include "stdafx.h"
#include "MarkSFX.h"
#include "iltclient.h"
#include "ltlink.h"
#include "GameClientShell.h"
#include "SurfaceFunctions.h"
#include "VarTrack.h"
extern CGameClientShell* g_pGameClientShell;
VarTrack g_cvarClipMarks;
VarTrack g_cvarLightMarks;
VarTrack g_cvarShowMarks;
VarTrack g_cvarMarkFadeTime;
VarTrack g_cvarMarkSolidTime;
// ----------------------------------------------------------------------- //
//
// ROUTINE: CMarkSFX::Init
//
// PURPOSE: Create the mark
//
// ----------------------------------------------------------------------- //
LTBOOL CMarkSFX::Init(SFXCREATESTRUCT* psfxCreateStruct)
{
if (!psfxCreateStruct) return LTFALSE;
CSpecialFX::Init(psfxCreateStruct);
MARKCREATESTRUCT* pMark = (MARKCREATESTRUCT*)psfxCreateStruct;
m_Rotation = pMark->m_Rotation;
VEC_COPY(m_vPos, pMark->m_vPos);
m_fScale = pMark->m_fScale;
m_nAmmoId = pMark->nAmmoId;
m_nSurfaceType = pMark->nSurfaceType;
if (!g_cvarClipMarks.IsInitted())
{
g_cvarClipMarks.Init(g_pLTClient, "MarksClip", NULL, 0.0f);
}
if (!g_cvarLightMarks.IsInitted())
{
g_cvarLightMarks.Init(g_pLTClient, "MarkLight", NULL, 0.0f);
}
if (!g_cvarShowMarks.IsInitted())
{
g_cvarShowMarks.Init(g_pLTClient, "MarkShow", NULL, 1.0f);
}
if (!g_cvarMarkFadeTime.IsInitted())
{
g_cvarMarkFadeTime.Init(g_pLTClient, "MarkFadeTime", NULL, 3.0f);
}
if (!g_cvarMarkSolidTime.IsInitted())
{
g_cvarMarkSolidTime.Init(g_pLTClient, "MarkSolidTime", NULL, 3.0f);
}
return LTTRUE;
}
// ----------------------------------------------------------------------- //
//
// ROUTINE: CMarkSFX::CreateObject
//
// PURPOSE: Create object associated with the mark
//
// ----------------------------------------------------------------------- //
LTBOOL CMarkSFX::CreateObject(ILTClient *pClientDE)
{
if (!CSpecialFX::CreateObject(pClientDE) || !g_pGameClientShell) return LTFALSE;
CSFXMgr* psfxMgr = g_pGameClientShell->GetSFXMgr();
if (!psfxMgr) return LTFALSE;
// If we're not showing marks, don't bother...
if (!g_cvarShowMarks.GetFloat()) return LTFALSE;
// Before we create a new buillet hole see if there is already another
// bullet hole close by that we could use instead...
CSpecialFXList* pList = psfxMgr->GetFXList(SFX_MARK_ID);
if (!pList) return LTFALSE;
int nNumBulletHoles = pList->GetSize();
HOBJECT hMoveObj = LTNULL;
HOBJECT hObj = LTNULL;
LTFLOAT fClosestMarkDist = REGION_DIAMETER;
uint8 nNumInRegion = 0;
LTVector vPos;
for (int i=0; i < nNumBulletHoles; i++)
{
if ((*pList)[i])
{
hObj = (*pList)[i]->GetObject();
if (hObj)
{
g_pLTClient->GetObjectPos(hObj, &vPos);
LTFLOAT fDist = VEC_DISTSQR(vPos, m_vPos);
if (fDist < REGION_DIAMETER)
{
if (fDist < fClosestMarkDist)
{
fClosestMarkDist = fDist;
hMoveObj = hObj;
}
if (++nNumInRegion > MAX_MARKS_IN_REGION)
{
// Just move this bullet-hole to the correct pos, and
// remove thyself...
g_pLTClient->SetObjectPos(hMoveObj, &m_vPos);
return LTFALSE;
}
}
}
}
}
// Setup the mark...
ObjectCreateStruct createStruct;
INIT_OBJECTCREATESTRUCT(createStruct);
LTFLOAT fScaleAdjust = 1.0f;
if (!GetImpactSprite((SurfaceType)m_nSurfaceType, fScaleAdjust, m_nAmmoId,
createStruct.m_Filename, ARRAY_LEN(createStruct.m_Filename)))
{
return LTFALSE;
}
createStruct.m_ObjectType = OT_SPRITE;
createStruct.m_Flags = FLAG_VISIBLE | FLAG_ROTATEABLESPRITE;
// Should probably force this in low detail modes...
if (g_cvarLightMarks.GetFloat() == 0.0f)
{
createStruct.m_Flags |= FLAG_NOLIGHT;
}
VEC_COPY(createStruct.m_Pos, m_vPos);
createStruct.m_Rotation = m_Rotation;
m_hObject = pClientDE->CreateObject(&createStruct);
m_fScale *= fScaleAdjust;
m_pClientDE->SetObjectScale(m_hObject, <Vector(m_fScale, m_fScale, m_fScale));
if (g_cvarClipMarks.GetFloat() > 0)
{
// Clip the mark to th poly...
IntersectQuery qInfo;
IntersectInfo iInfo;
LTVector vF = m_Rotation.Forward();
qInfo.m_From = m_vPos + (vF * 2.0);
qInfo.m_To = m_vPos - (vF * 2.0);
qInfo.m_Flags = IGNORE_NONSOLID | INTERSECT_HPOLY;
if (g_pLTClient->IntersectSegment(&qInfo, &iInfo))
{
g_pLTClient->ClipSprite(m_hObject, iInfo.m_hPoly);
}
}
LTFLOAT r, g, b, a;
r = g = b = 0.5f;
a = 1.0f;
m_pClientDE->SetObjectColor(m_hObject, r, g, b, a);
m_fElapsedTime = 0.0f;
return LTTRUE;
}
// ----------------------------------------------------------------------- //
//
// ROUTINE: CMarkSFX::WantRemove
//
// PURPOSE: If this gets called, remove the mark (this should only get
// called if we have a server object associated with us, and
// that server object gets removed).
//
// ----------------------------------------------------------------------- //
void CMarkSFX::WantRemove(LTBOOL bRemove)
{
CSpecialFX::WantRemove(bRemove);
if (!g_pGameClientShell) return;
CSFXMgr* psfxMgr = g_pGameClientShell->GetSFXMgr();
if (!psfxMgr) return;
// Tell the special fx mgr to go ahead and remove us...
if (m_hObject)
{
psfxMgr->RemoveSpecialFX(m_hObject);
}
}
// ----------------------------------------------------------------------- //
//
// ROUTINE: CMarkSFX::Update
//
// PURPOSE: Always return TRUE, however check to see if we should
// hide/show the mark.
//
// ----------------------------------------------------------------------- //
LTBOOL CMarkSFX::Update()
{
if (!g_cvarShowMarks.GetFloat())
{
// Remove the object...
return LTFALSE;
}
//make sure that we don't update while paused
if(g_pGameClientShell->IsServerPaused())
{
return LTTRUE;
}
m_fElapsedTime += g_pLTClient->GetFrameTime();
LTFLOAT fFadeStartTime = g_cvarMarkSolidTime.GetFloat();
LTFLOAT fFadeEndTime = fFadeStartTime + g_cvarMarkFadeTime.GetFloat();
if (m_fElapsedTime > fFadeEndTime)
{
// Remove the object...
return LTFALSE;
}
else if (m_fElapsedTime > fFadeStartTime)
{
LTFLOAT fScale = ((fFadeEndTime - m_fElapsedTime) / fFadeStartTime);
LTFLOAT r, g, b, a;
g_pLTClient->GetObjectColor(m_hObject, &r, &g, &b, &a);
a = a < fScale ? a : fScale;
g_pLTClient->SetObjectColor(m_hObject, r, g, b, a);
}
return LTTRUE;
} | [
"[email protected]"
] | [
[
[
1,
279
]
]
] |
0ce91c6266075a69d35cde1430f77efabbd9cbe5 | 3ea33f3b6b61d71216d9e81993a7b6ab0898323b | /src/Network/NetworkEntity.cpp | 68b336c532479d1ef32dbdacb2ea741446143abb | [] | no_license | drivehappy/tlmp | fd1510f48ffea4020a277f28a1c4525dffb0397e | 223c07c6a6b83e4242a5e8002885e23d0456f649 | refs/heads/master | 2021-01-10T20:45:15.629061 | 2011-07-07T00:43:00 | 2011-07-07T00:43:00 | 32,191,389 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 82 | cpp | #include "NetworkEntity.h"
int TLMP::NetworkEntity::m_iUniqueIdGenerator = 0;
| [
"drivehappy@7af81de8-dd64-11de-95c9-073ad895b44c"
] | [
[
[
1,
3
]
]
] |
b0237a40aadf571b7f97f7014fa22761a806626b | b8fbe9079ce8996e739b476d226e73d4ec8e255c | /src/engine/rb_ui/jcombobox.h | 500917b72f0a400ea7c28f58b1d2ae9db35f97f7 | [] | no_license | dtbinh/rush | 4294f84de1b6e6cc286aaa1dd48cf12b12a467d0 | ad75072777438c564ccaa29af43e2a9fd2c51266 | refs/heads/master | 2021-01-15T17:14:48.417847 | 2011-06-16T17:41:20 | 2011-06-16T17:41:20 | 41,476,633 | 1 | 0 | null | 2015-08-27T09:03:44 | 2015-08-27T09:03:44 | null | UTF-8 | C++ | false | false | 2,336 | h | /***********************************************************************************/
// File: JComboBox.h
// Date: 16.08.2005
// Author: Ruslan Shestopalyuk
/***********************************************************************************/
#ifndef __JCOMBOBOX_H__
#define __JCOMBOBOX_H__
#include "jweakref.h"
class JButton;
class JListBox;
/***********************************************************************************/
// Class: JComboBox
// Desc: Drop-list selection box
/***********************************************************************************/
class JComboBox : public JWidget
{
JWeakRef<JButton> m_pThumb;
JWeakRef<JListBox> m_pDropList;
int m_DropHeight; // default height of the drop-list
bool m_bThumbLeft; // whether draw thumb at left part of edit box
int m_LastSelection; // last item being selected before drop-down
int m_SelectedItem; // currently selected item
public:
JComboBox ();
virtual void OnSize ();
virtual void OnFocus ( bool bEnter );
virtual void Init ();
virtual void Render ();
int GetDropHeight () const;
void SetDropHeight ( int val );
bool IsDropVisible () const;
void SetDropVisible ( bool bVisible );
virtual void OnMouse ( JMouseEvent& m );
void DropDown ();
void DropUp ();
int GetSelectedItem () const { return m_SelectedItem; }
void SelectItem ( int idx );
expose(JComboBox)
{
parent(JWidget);
prop ( "DropHeight", GetDropHeight, SetDropHeight );
prop ( "DropVisible", IsDropVisible, SetDropVisible );
field( "ThumbLeft", m_bThumbLeft );
method( "DropDown", DropDown );
method( "DropUp", DropUp );
prop ( "SelectedItem", GetSelectedItem, SelectItem );
}
}; // class JComboBox
#endif //__JCOMBOBOX_H__
| [
"[email protected]"
] | [
[
[
1,
57
]
]
] |
b62e3a1779eb3b332a68643bada05d17709160da | 0454def9ffc8db9884871a7bccbd7baa4322343b | /src/playlistdetails/QUPlaylistArea.cpp | 21e0a239c19c71c045d0a358054aa07706ed00b4 | [] | no_license | escaped/uman | e0187d1d78e2bb07dade7ef6ef041b6ed424a2d3 | bedc1c6c4fc464be4669f03abc9bac93e7e442b0 | refs/heads/master | 2016-09-05T19:26:36.679240 | 2010-07-26T07:55:31 | 2010-07-26T07:55:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,194 | cpp | #include "QUPlaylistArea.h"
#include "QUProgressDialog.h"
#include "QUMessageBox.h"
#include "QULogService.h"
#include "QUSongDatabase.h"
#include <QFileDialog>
#include <QDir>
#include <QFileInfo>
#include <QFileInfoList>
#include <QList>
#include <QFile>
#include <QMessageBox>
#include "QUSongSupport.h"
#include "QUSongDatabase.h"
#include "QUPlaylistDatabase.h"
#include "QUPlaylistModel.h"
#include "QUPlaylistDBModel.h"
QUPlaylistArea::QUPlaylistArea(QWidget *parent): QWidget(parent) {
setupUi(this);
// connect(playlist, SIGNAL(removePlaylistEntryRequested(QUPlaylistEntry*)), this, SLOT(removeCurrentPlaylistEntry(QUPlaylistEntry*)));
// connect(playlist, SIGNAL(orderChanged(QList<QUPlaylistEntry*>)), this, SLOT(changeCurrentPlaylistOrder(QList<QUPlaylistEntry*>)));
// connect(playlist, SIGNAL(removeUnknownEntriesRequested()), this, SLOT(removeUnknownEntries()));
connect(playlistCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setCurrentPlaylist(int)));
connect(playlistEdit, SIGNAL(textEdited(const QString&)), this, SLOT(updateCurrentPlaylistName(const QString&)));
// connect(savePlaylistBtn, SIGNAL(clicked()), this, SLOT(saveCurrentPlaylist()));
// connect(savePlaylistAsBtn, SIGNAL(clicked()), this, SLOT(saveCurrentPlaylistAs()));
// connect(createPlaylistBtn, SIGNAL(clicked()), this, SLOT(addPlaylist()));
connect(browseBtn, SIGNAL(clicked()), this, SLOT(browse()));
// connect(removePlaylistBtn, SIGNAL(clicked()), this, SLOT(removeCurrentPlaylist()));
// connect(playlistDB, SIGNAL(databaseDisconnected()), this, SLOT(update())); // really needed ?! may be slow...
// connect(playlistDB, SIGNAL(databaseConnected()), this, SLOT(update()));
// connect(playlistDB, SIGNAL(databaseCleared()), this, SLOT(reset()));
connect(playlistDB, SIGNAL(databaseReloaded()), this, SLOT(reset()));
connect(playlistDB, SIGNAL(playlistAdded(QUPlaylistFile*)), this, SLOT(integratePlaylist(QUPlaylistFile*)));
// connect(songDB, SIGNAL(songChanged(QUSongFile*)), this, SLOT(update()));
playlistCombo->view()->setTextElideMode(Qt::ElideRight);
playlistCombo->setModel(new QUPlaylistDBModel(playlistCombo));
}
QUPlaylistFile* QUPlaylistArea::currentPlaylist() const {
if(playlistDB->playlists().isEmpty())
return 0;
return playlistDB->playlists().at(this->currentPlaylistIndex());
}
/*!
* Reset all UI elements according to the playlist database.
*/
void QUPlaylistArea::reset() {
playlistCombo->setCurrentIndex(0);
playlistEdit->clear();
// Disable not needed controls.
setAreaEnabled(false);
// update window title of parent dock widget with current playlist path
playlistPathLbl->setText(QString(tr("<font color=#808080>%1</font>")).arg(playlistDB->dir().path()));
}
/*!
* Update the current playlist view and the combobox items.
*/
void QUPlaylistArea::update() {
updatePlaylistCombo();
updateCurrentPlaylistConnections();
}
/*!
* Create a new entry in the current playlist for the given song.
*/
void QUPlaylistArea::addSongToCurrentPlaylist(QUSongFile *song) {
if(!song)
return;
if(!currentPlaylist()) {
logSrv->add(QString("Could NOT add song \"%1 - %2\" to playlist. Try to create a new playlist.").arg(song->artist()).arg(song->title()), QU::Warning);
return;
}
currentPlaylist()->addEntry(song);
// updatePlaylistCombo(); // indicate changes
// playlist->appendItem(currentPlaylist()->last());
}
/*!
* Shows the playlist with the given index in the playlist widget.
*/
void QUPlaylistArea::setCurrentPlaylist(int index) {
if(currentPlaylistIndex(index) < 0)
return;
QUPlaylistFile *list = playlistDB->at(currentPlaylistIndex(index));
list->connectSongs();
qobject_cast<QUPlaylistModel*>(playlist->model())->setIndex(index);
playlistEdit->setText(list->name());
// for "new" playlists, disable the "save" button -> user should use "save as" instead
savePlaylistBtn->setEnabled( list->fileInfo().exists() );
}
/*!
* Looks for changes in the playlists and updates the combo box.
*/
void QUPlaylistArea::updatePlaylistCombo() {
if(playlistDB->size() > 0 && playlistCombo->currentIndex() < 0)
playlistCombo->setCurrentIndex(0);
// QUProgressDialog dlg(tr("Update playlists..."), playlistDB->size(), this, false);
// dlg.setPixmap(":/control/playlist.png");
// dlg.show();
//
// for(int i = 0; i < playlistCombo->count(); i++) {
// if(currentPlaylistIndex(i) < 0)
// continue;
//
// QString heading = "%1%3 (%2)";
// heading = heading
// .arg( playlistDB->at(currentPlaylistIndex(i))->name() )
// .arg( QUPlaylistFile::dir().relativeFilePath(_playlists.at(currentPlaylistIndex(i))->fileInfo().filePath()) );
//
// dlg.update(heading.arg(""));
//
// if(playlistDB.at(currentPlaylistIndex(i))->hasUnsavedChanges())
// playlistCombo->setItemText(i, heading.arg("*"));
// else
// playlistCombo->setItemText(i, heading.arg(""));
// }
// TOFIX: Sorting switches current combobox index - why?
//playlistCombo->model()->sort(0);
}
/*!
* Looks for missing song connections in the current, visible playlist.
* \sa connectSongs()
*/
void QUPlaylistArea::updateCurrentPlaylistConnections() {
// if(currentPlaylistIndex() < 0)
// return;
//
// // connect songs with playlist entries
// playlistDB->at(currentPlaylistIndex())->connectSongs();
//
// // update view
// playlist->updateItems();
}
void QUPlaylistArea::updateCurrentPlaylistName(const QString &newName) {
if(currentPlaylistIndex() < 0)
return;
playlistDB->at(currentPlaylistIndex())->setName(newName);
}
void QUPlaylistArea::saveCurrentPlaylist() {
if(currentPlaylistIndex() < 0)
return;
playlistDB->at(currentPlaylistIndex())->save();
updatePlaylistCombo();
// playlist->updateItems();
}
void QUPlaylistArea::saveCurrentPlaylistAs() {
if(currentPlaylistIndex() < 0)
return;
QString filePath = QFileDialog::getSaveFileName(this, tr("Save playlist as..."), playlistDB->dir().path(), QString("UltraStar Playlists (%1)").arg(QUSongSupport::allowedPlaylistFiles().join(" ")));
if(!filePath.isEmpty()) {
QFileInfo oldFi = playlistDB->at(currentPlaylistIndex())->fileInfo();
// make current playlist to new playlist and save it
playlistDB->at(currentPlaylistIndex())->setFileInfo(QFileInfo(filePath));
this->saveCurrentPlaylist();
// restore old playlist, not needed for new, not-existent playlists
// if(oldFi.exists())
// this->addPlaylist(oldFi.filePath());
// file should exists now
// savePlaylistBtn->setEnabled(true);
}
}
/*!
* Creates a new, empty playlist.
*/
void QUPlaylistArea::integratePlaylist(QUPlaylistFile *playlist) {
setAreaEnabled(true);
// playlistCombo->addItem(
// QString("%1 (%2)")
// .arg(playlist->name())
// .arg(playlist->fileInfo().fileName()),
// playlistDB->indexOf(newPlaylist)); // save the correct index, needed for sorting
//
// playlistCombo->setCurrentIndex(playlistCombo->count() - 1); // select this new, empty playlist
// updatePlaylistCombo();
//
// playlistCombo->model()->sort(0);
//
// // Enable the user to start editing the name of the new playlist.
// playlistEdit->setFocus();
// playlistEdit->selectAll();
}
/*!
* For each index in the combobox there is a number saved in the userdata which maps
* to an index in the playlist list.
* \param index An index in the playlistCombo
* \returns An index in the playlist list. -1 on error.
*/
int QUPlaylistArea::currentPlaylistIndex(int index) const {
if(index == -1)
index = playlistCombo->currentIndex();
index = playlistCombo->itemData(index).toInt();
if(index < 0 or index >= playlistDB->playlists().size())
return -1;
return index;
}
/*!
* Used to disable all controls that will not be needed when no playlists
* are present.
*/
void QUPlaylistArea::setAreaEnabled(bool enabled) {
playlist->setEnabled(enabled);
playlistEdit->setEnabled(enabled);
savePlaylistBtn->setEnabled(enabled);
savePlaylistAsBtn->setEnabled(enabled);
removePlaylistBtn->setEnabled(enabled);
playlistCombo->setHidden(!enabled);
comboLbl->setText(enabled ? tr("Active List:") : tr("No playlists found. Try another folder:"));
if(!enabled) {
// playlist->clear();
playlistEdit->clear();
}
}
/*!
* Select a new folder and look there for new playlists. Old ones are discarded.
*/
void QUPlaylistArea::browse() {
if(playlistDB->hasUnsavedChanges()) {
int result = QUMessageBox::information(this,
tr("Change Playlist Directory"),
tr("Playlists have been modified."),
BTN << ":/control/save_all.png" << tr("Save all changed playlists.")
<< ":/control/bin.png" << tr("Discard all changes.")
<< ":/marks/cancel.png" << tr("Cancel this action."));
if(result == 0)
playlistDB->saveUnsavedChanges();
else if(result == 2)
return;
}
// --------------------------------------------
QString newPath = QFileDialog::getExistingDirectory(this, tr("Select a location for playlists"), playlistDB->dir().path());
if(!newPath.isEmpty())
playlistDB->setDir(newPath);
}
void QUPlaylistArea::removeCurrentPlaylist() {
if(!currentPlaylist())
return;
int result = QUMessageBox::information(this,
tr("Delete Playlist"),
QString(tr("<b>\"%1 (%2)\"</b> will be deleted permanently. You cannot undo a delete operation."))
.arg(currentPlaylist()->name())
.arg(currentPlaylist()->fileInfo().fileName()),
BTN << ":/control/bin.png" << tr("Delete this playlist.")
<< ":/marks/cancel.png" << tr("Cancel delete operation."));
if(result == 1)
return;
// --------------------------------------------
playlistDB->deletePlaylist(currentPlaylist());
int tmpIndex = currentPlaylistIndex();
QString tmpName = currentPlaylist()->name();
// update the index references in the userdata of each playlistCombo item
for(int i = 0; i < playlistCombo->count(); i++) {
int ref = playlistCombo->itemData(i).toInt();
if( ref > tmpIndex ) // There should be NO double indices! >=?
playlistCombo->setItemData(i, ref - 1);
}
// remove data structures
playlistCombo->removeItem(playlistCombo->currentIndex());
if(playlistCombo->count() == 0)
this->setAreaEnabled(false);
logSrv->add(QString(tr("The playlist \"%1\" was removed successfully.")).arg(tmpName), QU::Information);
}
void QUPlaylistArea::removeCurrentPlaylistEntry(QUPlaylistEntry *entry) {
if(currentPlaylistIndex() < 0)
return;
// _playlists.at(currentPlaylistIndex())->removeEntry(entry);
updatePlaylistCombo();
}
void QUPlaylistArea::removeUnknownEntries() {
if(currentPlaylistIndex() < 0)
return;
// _playlists.at(currentPlaylistIndex())->removeDisconnectedEntries();
updatePlaylistCombo();
}
/*!
* Due to internal drag&drop move.
*/
void QUPlaylistArea::changeCurrentPlaylistOrder(QList<QUPlaylistEntry*> newOrder) {
if(currentPlaylistIndex() < 0)
return;
// _playlists.at(currentPlaylistIndex())->changeOrder(newOrder);
// playlist->updateItems();
updatePlaylistCombo();
}
| [
"[email protected]"
] | [
[
[
1,
349
]
]
] |
e1a2980e0c9d0d31fde3866faa414840b8025c99 | 5d35825d03fbfe9885316ec7d757b7bcb8a6a975 | /inc/ResultManager.h | a4fdb5012a4d7c0ed82bc4153e922a69dd69a8ec | [] | no_license | jjzhang166/3D-Landscape-linux | ce887d290b72ebcc23386782dd30bdd198db93ef | 4f87eab887750e3dc5edcb524b9e1ad99977bd94 | refs/heads/master | 2023-03-15T05:24:40.303445 | 2010-03-25T00:23:43 | 2010-03-25T00:23:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 554 | h | #ifndef RESULTMANAGER_H
#define RESULTMANAGER_H
#include <QPainter>
#include <QList>
#include "Engine3D.h"
#include "ResultItem.h"
class Engine3D;
class ResultManager
{
public:
ResultManager(Engine3D *engine3D);
virtual ~ResultManager();
void deleteItems();
void addChild(QString label);
void render(QPainter *painter);
void resize(QSize mainWidgetSize);
void processMouseClick(int x, int y);
Engine3D *engine3D;
QList<ResultItem*> resultItems;
};
#endif //RESULTMANAGER_H
| [
"[email protected]"
] | [
[
[
1,
33
]
]
] |
737b519307032578cdce17b4a4707b97b59776d2 | cd07acbe92f87b59260478f62a6f8d7d1e218ba9 | /src/DISDLG.cpp | db28328fc45e882bf5ce5dba705760b102e38eac | [] | no_license | niepp/sperm-x | 3a071783e573d0c4bae67c2a7f0fe9959516060d | e8f578c640347ca186248527acf82262adb5d327 | refs/heads/master | 2021-01-10T06:27:15.004646 | 2011-09-24T03:33:21 | 2011-09-24T03:33:21 | 46,690,957 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 990 | cpp | // DISDLG.cpp : implementation file
//
#include "stdafx.h"
#include "sperm.h"
#include "DISDLG.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDISDLG dialog
CDISDLG::CDISDLG(CWnd* pParent /*=NULL*/)
: CDialog(CDISDLG::IDD, pParent)
{
//{{AFX_DATA_INIT(CDISDLG)
m_playtype = 4;
m_framefrequence = 5;
//}}AFX_DATA_INIT
}
void CDISDLG::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDISDLG)
DDX_Radio(pDX, IDC_RADIO7, m_playtype);
DDX_Text(pDX, IDC_EDIT1, m_framefrequence);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDISDLG, CDialog)
//{{AFX_MSG_MAP(CDISDLG)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDISDLG message handlers
| [
"harithchen@e030fd90-5f31-5877-223c-63bd88aa7192"
] | [
[
[
1,
45
]
]
] |
5874079f10e18b04862234694fa1e71a1e501cf4 | 7ee1bcc17310b9f51c1a6be0ff324b6e297b6c8d | /AppData/Sources/VS 2005 WinCE SDK 8.0 library/Source/stdafx.cpp | 9449b07347fc8ffee74e90861f5d6195530ce149 | [] | no_license | SchweinDeBurg/afx-scratch | 895585e98910f79127338bdca5b19c5e36921453 | 3181b779b4bb36ef431e5ce39e297cece1ca9cca | refs/heads/master | 2021-01-19T04:50:48.770595 | 2011-06-18T05:14:22 | 2011-06-18T05:14:22 | 32,185,218 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 995 | cpp | // $PROJECT$ static library.
// Copyright (c) $YEAR$ by $AUTHOR$,
// All rights reserved.
// stdafx.cpp - source file that includes just the standard includes
// initially generated by $GENERATOR$ on $DATE$ at $TIME$
// visit http://zarezky.spb.ru/projects/afx_scratch.html for more info
//////////////////////////////////////////////////////////////////////////////////////////////
// PCH includes
#include "stdafx.h"
//////////////////////////////////////////////////////////////////////////////////////////////
// linker options
#if defined(_DEBUG) || defined(DEBUG)
#pragma comment(linker, "/nodefaultlib:libcd.lib")
#else
#pragma comment(linker, "/nodefaultlib:libc.lib")
#endif // _DEBUG || DEBUG
//////////////////////////////////////////////////////////////////////////////////////////////
// required libraries
#if defined(_CPPRTTI) && (_WIN32_WCE < 0x500)
#pragma comment(lib, "ccrtrtti.lib")
#endif // _CPPRTTI && _WIN32_WCE
// end of file
| [
"Elijah@9edebcd1-9b41-0410-8d36-53a5787adf6b",
"Elijah Zarezky@9edebcd1-9b41-0410-8d36-53a5787adf6b"
] | [
[
[
1,
9
],
[
13,
14
],
[
16,
21
],
[
23,
23
],
[
25,
28
],
[
30,
31
]
],
[
[
10,
12
],
[
15,
15
],
[
22,
22
],
[
24,
24
],
[
29,
29
]
]
] |
5ac26179424114e50868d77425d17e5d5a01e488 | 842997c28ef03f8deb3422d0bb123c707732a252 | /src/uslsext/USSqlRecord.cpp | f161bd1346a5ec84d0ed892de8135951a9136eb7 | [] | no_license | bjorn/moai-beta | e31f600a3456c20fba683b8e39b11804ac88d202 | 2f06a454d4d94939dc3937367208222735dd164f | refs/heads/master | 2021-01-17T11:46:46.018377 | 2011-06-10T07:33:55 | 2011-06-10T07:33:55 | 1,837,561 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 14,091 | cpp | // Copyright (c) 2010-2011 Zipline Games, Inc. All Rights Reserved.
// http://getmoai.com
#include "pch.h"
#include <uslsext/USSqlConnection.h>
#include <uslsext/USSqlStatement.h>
#include <uslsext/USSqlRecord.h>
//================================================================//
// USSqlCell
//================================================================//
//----------------------------------------------------------------//
bool USSqlCell::Init ( sqlite3* connection, sqlite3_stmt* statement, int iCol ) {
USSqlColumn::GetSqlMetadata ( connection, statement, iCol );
this->mColID = iCol;
return true;
}
//----------------------------------------------------------------//
void USSqlCell::Print () {
this->USSqlColumn::Print ();
printf ( " = " );
this->mValue.Print ();
}
//----------------------------------------------------------------//
void USSqlCell::SetRowID ( s64 rowID ) {
if ( this->mIsAuto ) {
this->mValue.SetInt64 ( rowID );
}
}
//----------------------------------------------------------------//
bool USSqlCell::SkipWrite () {
if ( this->mIsAuto ) return true;
if ( !this->mValue.mIsDirty ) return true;
return false;
}
//----------------------------------------------------------------//
USSqlCell::USSqlCell () :
mColID ( 0xffffffff ) {
}
//----------------------------------------------------------------//
USSqlCell::~USSqlCell () {
}
//================================================================//
// USSqlRecord
//================================================================//
//----------------------------------------------------------------//
void USSqlRecord::AddColumn ( cc8* name, cc8* declType ) {
USSqlCell& cell = this->mCells [ name ];
cell.mTableName = this->mName;
cell.mColumnName = name;
cell.mDeclaredType = declType;
//USSqlColumn& col = cell;
//col.Init ( this->mConnection, this->mName, name );
}
//----------------------------------------------------------------//
bool USSqlRecord::Affirm ( cc8* where, ... ) {
STLString whereClause;
STLSTRING_APPEND_VA_ARGS ( whereClause, where, where );
STLString command;
command.write ( "SELECT * FROM %s %s", this->mName.str (), whereClause.str ());
USSqlStatement statement ( this->mConnection );
statement.Prepare ( command );
if ( statement.StepRow ()) {
return this->Update ( whereClause );
}
s64 rowid = this->Insert ();
if ( rowid ) {
return this->Select ( "WHERE ROWID = %lld", rowid );
}
return false;
}
//----------------------------------------------------------------//
bool USSqlRecord::Check ( cc8* where, ... ) {
STLString whereClause;
STLSTRING_APPEND_VA_ARGS ( whereClause, where, where );
STLString command;
command.write ( "SELECT * FROM %s %s", this->mName.str (), whereClause.str ());
USSqlStatement statement ( this->mConnection );
statement.Prepare ( command );
return statement.StepRow ();
}
//----------------------------------------------------------------//
void USSqlRecord::Clear () {
this->mCells.clear ();
this->mName = "";
this->mConnection = 0;
}
//----------------------------------------------------------------//
bool USSqlRecord::CreateTable () {
USSqlStatement statement ( this->mConnection );
STLString command;
command.write ( "CREATE TABLE IF NOT EXISTS %s ( ", this->mName.str ());
cc8* delim = "";
CellIt cellIt = this->mCells.begin ();
for ( ; cellIt != this->mCells.end (); ++cellIt ) {
USSqlCell& cell = cellIt->second;
command.write ( "%s%s %s", delim, cell.mColumnName.str (), cell.mDeclaredType.str ());
delim = ", ";
}
command.write ( " )" );
statement.Prepare ( command );
bool result = statement.Step ();
if ( result ) {
cellIt = this->mCells.begin ();
for ( ; cellIt != this->mCells.end (); ++cellIt ) {
USSqlCell& cell = cellIt->second;
cell.GetSqlMetadata ( this->mConnection );
}
}
return result;
}
//----------------------------------------------------------------//
bool USSqlRecord::Delete ( cc8* where, ... ) {
if ( !this->mConnection ) return false;
USSqlStatement statement ( this->mConnection );
STLString command;
command.write ( "DELETE FROM %s ", this->mName.str ());
STLSTRING_APPEND_VA_ARGS ( command, where, where );
statement.Prepare ( command );
return statement.Step ();
}
//----------------------------------------------------------------//
void USSqlRecord::DropColumn ( cc8* name ) {
UNUSED ( name );
}
//----------------------------------------------------------------//
bool USSqlRecord::ExtendTable () {
USSqlStatement statement ( this->mConnection );
CellIt cellIt;
cellIt = this->mCells.begin ();
for ( ; cellIt != this->mCells.end (); ++cellIt ) {
USSqlCell& cell = cellIt->second;
cell.GetSqlMetadata ( this->mConnection );
}
statement.Execute ( "BEGIN IMMEDIATE TRANSACTION" );
cellIt = this->mCells.begin ();
for ( ; cellIt != this->mCells.end (); ++cellIt ) {
USSqlCell& cell = cellIt->second;
if ( !cell.mColumnExists ) {
statement.Execute ( "ALTER TABLE %s ADD COLUMN %s %s", this->mName.str (), cell.mColumnName.str (), cell.mDeclaredType.str ());
}
}
statement.Execute ( "COMMIT TRANSACTION" );
cellIt = this->mCells.begin ();
for ( ; cellIt != this->mCells.end (); ++cellIt ) {
USSqlCell& cell = cellIt->second;
cell.GetSqlMetadata ( this->mConnection );
}
return true;
}
//----------------------------------------------------------------//
bool USSqlRecord::GetBool ( cc8* colName, bool value ) {
int intVal = value ? 1 : 0;
intVal = this->GetInt ( colName, intVal );
return intVal ? true : false;
}
//----------------------------------------------------------------//
USSqlCell* USSqlRecord::GetCell ( cc8* name ) {
if ( this->mCells.contains ( name )) {
return &this->mCells [ name ];
}
if ( USSqlColumn::Exists ( this->mConnection, this->mName, name )) {
USSqlCell& cell = this->mCells [ name ];
cell.USSqlColumn::GetSqlMetadata ( this->mConnection, this->mName, name );
return &cell;
}
return 0;
}
//----------------------------------------------------------------//
USSqlCell* USSqlRecord::GetCell ( cc8* name, int type ) {
if ( this->mCells.contains ( name )) {
USSqlCell& cell = this->mCells [ name ];
if ( cell.mValue.mType == type ) {
return &cell;
}
}
return 0;
}
//----------------------------------------------------------------//
sqlite3* USSqlRecord::GetConnection () {
return this->mConnection;
}
//----------------------------------------------------------------//
double USSqlRecord::GetDouble ( cc8* colName, double value ) {
USSqlCell* cell = this->GetCell ( colName, SQLITE_FLOAT );
if ( cell ) {
return cell->mValue.GetDouble ( value );
}
return value;
}
//----------------------------------------------------------------//
float USSqlRecord::GetFloat ( cc8* colName, float value ) {
return ( float )this->GetDouble ( colName, value );
}
//----------------------------------------------------------------//
s32 USSqlRecord::GetInt ( cc8* colName, s32 value ) {
return ( s32 )this->GetInt64 ( colName, value );
}
//----------------------------------------------------------------//
s64 USSqlRecord::GetInt64 ( cc8* colName, s64 value ) {
USSqlCell* cell = this->GetCell ( colName, SQLITE_INTEGER );
if ( cell ) {
return cell->mValue.GetInt64 ( value );
}
return value;
}
//----------------------------------------------------------------//
cc8* USSqlRecord::GetString ( cc8* colName, cc8* value ) {
USSqlCell* cell = this->GetCell ( colName, SQLITE_TEXT );
if ( cell ) {
return cell->mValue.GetString ( value );
}
return value;
}
//----------------------------------------------------------------//
void USSqlRecord::Init ( sqlite3* connection, cc8* tableName ) {
this->Clear ();
this->mName = tableName;
this->mConnection = connection;
}
//----------------------------------------------------------------//
s64 USSqlRecord::Insert () {
if ( !this->mConnection ) return false;
USSqlStatement statement ( this->mConnection );
STLString command;
command.write ( "INSERT INTO %s ( ", this->mName.str ());
cc8* delim;
CellIt cellIt;
delim = "";
cellIt = this->mCells.begin ();
for ( ; cellIt != this->mCells.end (); ++cellIt ) {
USSqlCell& cell = cellIt->second;
if ( cell.SkipWrite ()) continue;
command.write ( "%s%s", delim, cell.mColumnName.str ());
delim = ", ";
}
command += " ) VALUES ( ";
delim = "";
cellIt = this->mCells.begin ();
for ( ; cellIt != this->mCells.end (); ++cellIt ) {
USSqlCell& cell = cellIt->second;
if ( cell.SkipWrite ()) continue;
command.write ( "%s?", delim );
delim = ", ";
}
command.write ( " )" );
statement.Prepare ( command );
cellIt = this->mCells.begin ();
int idx = 1;
for ( ; cellIt != this->mCells.end (); ++cellIt ) {
USSqlCell& cell = cellIt->second;
if ( cell.SkipWrite ()) continue;
cell.mValue.Bind ( statement, idx );
++idx;
}
bool result = statement.Step ();
if ( result ) {
return sqlite3_last_insert_rowid ( this->mConnection );
}
return 0;
}
//----------------------------------------------------------------//
bool USSqlRecord::InsertSelect () {
s64 rowid = this->Insert ();
if ( rowid ) {
return this->Select ( "WHERE ROWID = %lld", rowid );
}
return false;
}
//----------------------------------------------------------------//
bool USSqlRecord::LoadCells ( sqlite3_stmt* statement ) {
bool addCells = ( this->mCells.size () == 0 );
int count = sqlite3_column_count ( statement );
for ( int i = 0; i < count; ++i ) {
cc8* collTableName = sqlite3_column_table_name ( statement, i );
if ( strcmp ( collTableName, this->mName ) != 0 ) continue;
cc8* collName = sqlite3_column_origin_name ( statement, i );
if ( addCells || this->mCells.contains ( collName )) {
USSqlCell& cell = this->mCells [ collName ];
cell.GetSqlMetadata ( this->mConnection, statement, i );
cell.mValue.Load ( statement, i );
}
}
return true;
}
//----------------------------------------------------------------//
void USSqlRecord::PrintCells () {
printf ( "Record row:\n" );
// just the values, ma'am...
CellIt cellIt = this->mCells.begin ();
for ( ; cellIt != this->mCells.end (); ++cellIt ) {
USSqlCell& cell = cellIt->second;
printf ( "\t" );
cell.Print ();
printf ( "\n" );
}
}
//----------------------------------------------------------------//
void USSqlRecord::Reset () {
this->mCells.clear ();
}
//----------------------------------------------------------------//
bool USSqlRecord::Select ( cc8* where, ... ) {
if ( !this->mConnection ) return false;
USSqlStatement statement ( this->mConnection );
cc8* tableName = this->mName.str ();
STLString command;
command.write ( "SELECT * FROM %s ", tableName );
STLSTRING_APPEND_VA_ARGS ( command, where, where );
statement.Prepare ( command );
if ( statement.StepRow ()) {
this->LoadCells ( statement );
return true;
}
return false;
}
//----------------------------------------------------------------//
void USSqlRecord::SetBool ( cc8* colName, bool value ) {
int intVal = value ? 1 : 0;
this->SetInt ( colName, intVal );
}
//----------------------------------------------------------------//
void USSqlRecord::SetDouble ( cc8* colName, double value ) {
USSqlCell* cell = this->GetCell ( colName );
if ( cell ) {
cell->mValue.SetDouble ( value );
}
}
//----------------------------------------------------------------//
void USSqlRecord::SetFloat ( cc8* colName, float value ) {
this->SetDouble ( colName, value );
}
//----------------------------------------------------------------//
void USSqlRecord::SetInt ( cc8* colName, s32 value ) {
this->SetInt64 ( colName, value );
}
//----------------------------------------------------------------//
void USSqlRecord::SetInt64 ( cc8* colName, s64 value ) {
USSqlCell* cell = this->GetCell ( colName );
if ( cell ) {
//if ( cell->mIsAuto ) return;
cell->mValue.SetInt64 ( value );
}
}
//----------------------------------------------------------------//
void USSqlRecord::SetNull ( cc8* colName ) {
UNUSED ( colName );
}
//----------------------------------------------------------------//
void USSqlRecord::SetString ( cc8* colName, cc8* value ) {
USSqlCell* cell = this->GetCell ( colName );
if ( cell ) {
cell->mValue.SetString ( value );
}
}
//----------------------------------------------------------------//
bool USSqlRecord::Update ( cc8* where, ... ) {
if ( !this->mConnection ) return false;
USSqlStatement statement ( this->mConnection );
STLString command;
command.write ( "UPDATE %s SET ", this->mName.str ());
cc8* delim = "";
CellIt cellIt = this->mCells.begin ();
for ( ; cellIt != this->mCells.end (); ++cellIt ) {
USSqlCell& cell = cellIt->second;
if ( cell.SkipWrite ()) continue;
command.write ( "%s%s = ?", delim, cell.mColumnName.str ());
delim = ", ";
}
command.write ( " " );
STLSTRING_APPEND_VA_ARGS ( command, where, where );
// prepare the statement
statement.Prepare ( command );
// bind the values
cellIt = this->mCells.begin ();
int idx = 1;
for ( ; cellIt != this->mCells.end (); ++cellIt ) {
USSqlCell& cell = cellIt->second;
if ( cell.SkipWrite ()) continue;
cell.mValue.Bind ( statement, idx );
++idx;
}
return statement.Step ();
}
//----------------------------------------------------------------//
USSqlRecord::USSqlRecord () :
mConnection ( 0 ) {
}
//----------------------------------------------------------------//
USSqlRecord::~USSqlRecord () {
}
| [
"[email protected]"
] | [
[
[
1,
528
]
]
] |
2c8782caef11cf4609c6ca799379e2e02383166f | 23b2ab84309de65b42333c87e0de088503e2cb36 | /src/gui/tabpage_p.h | 10a15c507ad06eb6b22dc0bfc8ebab3cea5fc69a | [] | no_license | fyrestone/simple-pms | 74a771d83979690eac231a82f1c457d7b6c55f41 | 1917d5c4e14bf7829707bacb9cc2452b49d6cc2b | refs/heads/master | 2021-01-10T20:36:39.403902 | 2011-04-16T15:38:12 | 2011-04-16T15:38:12 | 32,192,134 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 295 | h | #ifndef TABPAGE_P_H
#define TABPAGE_P_H
#include <QtCore/QObject> /* Q_DECLARE_PUBLIC使用 */
class TabPagePrivate
{
Q_DECLARE_PUBLIC(TabPage)
public:
TabPagePrivate(TabPage *parent) : q_ptr(parent){}
private:
TabPage * const q_ptr;
};
#endif // TABPAGE_P_H
| [
"[email protected]@95127988-2b6b-df20-625d-5ecc0e46e2bb"
] | [
[
[
1,
17
]
]
] |
d388b628af1cad137687a346f13d31b64e2f036e | bd89d3607e32d7ebb8898f5e2d3445d524010850 | /adaptationlayer/tsy/nokiatsy_dll/inc/cmmconferencecallmesshandler.h | 8448b444ca7327aea9c6631cbb9cf91a87dfca81 | [] | no_license | wannaphong/symbian-incubation-projects.fcl-modemadaptation | 9b9c61ba714ca8a786db01afda8f5a066420c0db | 0e6894da14b3b096cffe0182cedecc9b6dac7b8d | refs/heads/master | 2021-05-30T05:09:10.980036 | 2010-10-19T10:16:20 | 2010-10-19T10:16:20 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,875 | h | /*
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/
#ifndef CMMCONFERENCECALLMESSHANDLER_H
#define CMMCONFERENCECALLMESSHANDLER_H
// INCLUDES
#include "mmmmesshandlerbase.h"
#include "cmmphonetreceiver.h"
#include <e32base.h>
// CONSTANTS
// hard-coded transaction id for ISI messages
const TUint8 KConferenceCallTransId = 2;
// MACROS
// None
// DATA TYPES
// None
// FUNCTION PROTOTYPES
// None
// FORWARD DECLARATIONS
class CMmPhoNetSender;
class CMmMessageRouter;
// CLASS DECLARATION
/**
* Used for creating and sending conference call ISI messages to
* PhoNet via PhoNetSender. It also receives conference call
* ISI messages from PhoNetReceiver.
*/
class CMmConferenceCallMessHandler :
public CBase,
public MMmMessHandlerBase,
public MMmMessageReceiver
{
public: // Constructors and destructor
/**
* Two-phased constructor.
* @param aPhoNetSender pointer to the Phonet sender
* @param aPhoNetReceiver pointer to the Phonet receiver
* @param aMessageRouter pointer to the message router object
* @return created message handler object
*/
static CMmConferenceCallMessHandler* NewL(
CMmPhoNetSender* aPhoNetSender,
CMmPhoNetReceiver* aPhoNetReceiver,
CMmMessageRouter* aMessageRouter );
/**
* Destructor.
*/
~CMmConferenceCallMessHandler();
public: // Methods from base classes
/**
* From MMmMessHandlerBase. This method is the single entry point for
* requests coming from the Symbian OS layer to this message handler
* @param aIpc IPC number of the request
* @param CMmDataPackage* aDataPackage: pointer to datapackage
* @return KErrNone or error code
*/
TInt ExtFuncL( TInt aIpc, const CMmDataPackage* aDataPackage );
public: // New functions
/**
* Checks if the received message should be handled in the common
* Conference Call Message handler.
* @param aIsiMsg, reference to the received message.
*/
void ReceiveMessageL( const TIsiReceiveC& aIsiMsg );
/**
* Handles errors comes from PhoNetReceiver RunError
* @param aIsiMsg The received ISI message
* @param aError: Error code
*/
void HandleError( const TIsiReceiveC& aIsiMsg, TInt aError );
protected: // New functions
/**
* C++ default constructor.
*/
CMmConferenceCallMessHandler();
private:
/**
* By default Symbian OS constructor is private.
*/
void ConstructL();
private: // New functions
/**
* Creates Call control request ( create conference call etc. ) ISI
* message and sends it to Phonet.
* @param aTransactionId: unique TransactionId number
* @param aCallId: call ID (sometimes common CC Call ID)
* @param aOperation: control operation
* @param aIsCreateConference: is this CreateConference request
* @return success/failure value
*/
TInt CallControlReq(
TUint8 aTransactionId,
TUint8 aCallId,
TUint8 aOperation,
TBool aIsCreateConference );
/**
* Breaks received CallControlResp ISI message.
* @param aIsiMsg, reference to the received message.
*/
void CallControlResp( const TIsiReceiveC& aIsiMsg );
/**
* Breaks received CallControlInd ISI message.
* @param aIsiMsg, reference to the received message.
*/
void CallControlInd( const TIsiReceiveC& aIsiMsg );
/**
* Creates CallReleaseReq (HangUp conference call) ISI
* message and sends it to Phonet.
* @param aTransactionId, unique transaction id
* @param aCallId, Call ID of this call (Conference Call ID)
* @param aCause, cause of releasing
* @return success/failure value
*/
TInt CallReleaseReq(
TUint8 aTransactionId,
TUint8 aCallId,
TUint8 aCause );
/**
* Breaks received CallReleaseResp ISI message.
* @param aIsiMsg, reference to the received message.
*/
void CallReleaseResp( const TIsiReceiveC& aIsiMsg );
/**
* Utility function that maps an ETel call id to a call id
* in ISA Call Server's format.
* @param aETelCallId call Id in ETel format
* @return call Id in ISA format, or KCallIdNone if illegal argument.
*/
static TUint8 MapETelCallIdToISACallId( const TInt aETelCallId );
public: // Member data
// None
protected: // Member data
// None
private: // Member data
// Pointer to the PhonetSender
CMmPhoNetSender* iPhoNetSender;
// Last release cause value
TUint8 iReleaseCauseValueSent;
// Last transaction id for conference call creation
TBool iIsCreateConference;
// Last conference call control operation
TUint8 iLastOperation;
// Pointer to the CMmMessageRouter
CMmMessageRouter* iMessageRouter;
};
#endif // CMMCONFERENCECALLMESSHANDLER_H
// End of File
| [
"dalarub@localhost"
] | [
[
[
1,
201
]
]
] |
1f94f8e24b8f26e372b7ce1e316d5e4eb2b2fcca | 668dc83d4bc041d522e35b0c783c3e073fcc0bd2 | /fbide-wx/sdk/src/wxScintilla/scintilla/include/PropSet.h | 69f293eb32e2764252db3d0efa2a583e7b2b2738 | [
"LicenseRef-scancode-scintilla"
] | permissive | albeva/fbide-old-svn | 4add934982ce1ce95960c9b3859aeaf22477f10b | bde1e72e7e182fabc89452738f7655e3307296f4 | refs/heads/master | 2021-01-13T10:22:25.921182 | 2009-11-19T16:50:48 | 2009-11-19T16:50:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,595 | h | // Scintilla source code edit control
/** @file PropSet.h
** A Java style properties file module.
**/
// Copyright 1998-2002 by Neil Hodgson <[email protected]>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef PROPSET_H
#define PROPSET_H
#include "SString.h"
bool EqualCaseInsensitive(const char *a, const char *b);
bool isprefix(const char *target, const char *prefix);
#ifdef SCI_NAMESPACE
namespace Scintilla {
#endif
struct Property {
unsigned int hash;
char *key;
char *val;
Property *next;
Property() : hash(0), key(0), val(0), next(0) {}
};
/**
*/
class PropSet {
protected:
enum { hashRoots=31 };
Property *props[hashRoots];
Property *enumnext;
int enumhash;
static unsigned int HashString(const char *s, size_t len) {
unsigned int ret = 0;
while (len--) {
ret <<= 4;
ret ^= *s;
s++;
}
return ret;
}
public:
PropSet *superPS;
PropSet();
~PropSet();
void Set(const char *key, const char *val, int lenKey=-1, int lenVal=-1);
void Set(const char *keyVal);
void Unset(const char *key, int lenKey=-1);
void SetMultiple(const char *s);
SString Get(const char *key) const;
SString GetExpanded(const char *key) const;
SString Expand(const char *withVars, int maxExpands=100) const;
int GetInt(const char *key, int defaultValue=0) const;
void Clear();
char *ToString() const; // Caller must delete[] the return value
private:
// copy-value semantics not implemented
PropSet(const PropSet ©);
void operator=(const PropSet &assign);
};
/**
*/
class DLLIMPORT WordList {
public:
// Each word contains at least one character - a empty word acts as sentinel at the end.
char **words;
char *list;
int len;
bool onlyLineEnds; ///< Delimited by any white space or only line ends
bool sorted;
int starts[256];
WordList(bool onlyLineEnds_ = false) :
words(0), list(0), len(0), onlyLineEnds(onlyLineEnds_),
sorted(false)
{}
~WordList() { Clear(); }
operator bool() { return len ? true : false; }
void Clear();
void Set(const char *s);
bool InList(const char *s);
bool InListAbbreviated(const char *s, const char marker);
};
inline bool IsAlphabetic(unsigned int ch) {
return ((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z'));
}
#ifdef SCI_NAMESPACE
}
#endif
#ifdef _MSC_VER
// Visual C++ doesn't like the private copy idiom for disabling
// the default copy constructor and operator=, but it's fine.
#pragma warning(disable: 4511 4512)
#endif
#endif
| [
"vongodric@957c6b5c-1c3a-0410-895f-c76cfc11fbc7"
] | [
[
[
1,
104
]
]
] |
720f08bc29d8f1edc188bb68740857ddbf79b36d | a6364718e205f8a83f180f5f06703e8964d6eafe | /foo_lyricsgrabber2/foo_lyricsgrabber2/py_site.h | 9e1dddf2007a94d289ec29e284a042becc0b7d96 | [
"MIT"
] | permissive | LWain83/lyricsgrabber2 | b40f56303b7de120a8f12292e194faac661a79e3 | b71765433d6ac0c1d1b85b6b1d82de705c6d5718 | refs/heads/master | 2016-08-12T18:53:51.990628 | 2010-08-28T07:13:29 | 2010-08-28T07:13:29 | 52,316,826 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,610 | h | #pragma once
#include "py_class_wrapper.h"
enum t_version_info
{
VERSION_100 = 0x100,
};
struct script_info
{
std::string filename;
std::string name;
std::string author;
std::string description;
std::string url;
std::string version;
};
struct config_info_custom
{
std::string extra_libpath;
std::string extra_scriptpath;
};
class config_info : public pfc::list_t<script_info>, public config_info_custom
{
private:
static const int VERSION_CURRENT = VERSION_100;
public:
void read_from_stream(stream_reader * p_reader, t_size p_size, abort_callback & p_abort)
{
int version;
remove_all();
if (p_size <= sizeof(int) + sizeof(t_size))
return;
try
{
// Read version
p_reader->read_lendian_t(version, p_abort);
switch (version)
{
case VERSION_CURRENT:
t_size count;
p_reader->read_lendian_t(count, p_abort);
for (t_size i = 0; i < count; i++)
{
script_info info;
info.filename = p_reader->read_string(p_abort).get_ptr();
info.name = p_reader->read_string(p_abort).get_ptr();
info.author = p_reader->read_string(p_abort).get_ptr();
info.version = p_reader->read_string(p_abort).get_ptr();
info.description = p_reader->read_string(p_abort).get_ptr();
info.url = p_reader->read_string(p_abort).get_ptr();
add_item(info);
}
// Custom Info
extra_libpath = p_reader->read_string(p_abort).get_ptr();
extra_scriptpath = p_reader->read_string(p_abort).get_ptr();
break;
default:
remove_all();
return;
}
}
catch (...)
{
remove_all();
return;
}
}
void write_to_stream(stream_writer * p_writer, abort_callback & p_abort)
{
// Write version
p_writer->write_lendian_t(VERSION_CURRENT, p_abort);
// Write size
p_writer->write_lendian_t(get_count(), p_abort);
//
try
{
for (t_size i = 0; i < get_count(); i++)
{
script_info & info_ref = m_buffer[i];
p_writer->write_string(info_ref.filename.c_str(), p_abort);
p_writer->write_string(info_ref.name.c_str(), p_abort);
p_writer->write_string(info_ref.author.c_str(), p_abort);
p_writer->write_string(info_ref.version.c_str(), p_abort);
p_writer->write_string(info_ref.description.c_str(), p_abort);
p_writer->write_string(info_ref.url.c_str(), p_abort);
}
// Custom Info
p_writer->write_string(extra_libpath.c_str(), p_abort);
p_writer->write_string(extra_scriptpath.c_str(), p_abort);
}
catch (...)
{
// Do nothing here
}
}
};
class py_site
{
public:
~py_site() { _cleanup(); }
inline unsigned get_script_count() { return m_config_info.get_count(); }
inline const char * get_script_name(unsigned p_index) { return m_config_info[p_index].name.c_str(); }
inline config_info & get_config() { return m_config_info; }
bool invoke(unsigned p_index, metadb_handle_list_cref p_meta, threaded_process_status & p_status, abort_callback & p_abort, pfc::string_list_impl & p_data);
bool refresh();
void init();
void exec_file(const char * filename, PyObject * global, PyObject * local);
void enum_scripts(const char * p_folder, pfc::list_t<script_info> & p_out);
private:
void _cleanup();
bool componentPath;
pfc::string8 m_grabber_profile_path;
pfc::string8 m_grabber_component_path;
config_info m_config_info;
py_stdout_redirector m_stdout_redirector;
py_stderr_receiver m_stderr_receiver;
boost::python::object m_main_module;
boost::python::dict m_global_dict;
critical_section2 m_cs;
};
| [
"qudeid@d0561270-fede-e5e2-f771-9cccb1c17e5b"
] | [
[
[
1,
142
]
]
] |
80821b087820e096117d159f979b795749110e46 | b84a38aad619acf34c22ed6e6caa0f7b00ebfa0a | /Code/TootleAsset/TAudio.cpp | 73496a7346c81da7a428de854059e360aa65acaf | [] | no_license | SoylentGraham/Tootle | 4ae4e8352f3e778e3743e9167e9b59664d83b9cb | 17002da0936a7af1f9b8d1699d6f3e41bab05137 | refs/heads/master | 2021-01-24T22:44:04.484538 | 2010-11-03T22:53:17 | 2010-11-03T22:53:17 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,233 | cpp | #include "TAudio.h"
using namespace TLAsset;
TAudio::TAudio(const TRef& AssetRef) :
TAsset ( GetAssetType_Static(), AssetRef )
{
}
SyncBool TAudio::Shutdown()
{
return TAsset::Shutdown();
}
//-------------------------------------------------------
// load asset data out binary data
//-------------------------------------------------------
SyncBool TAudio::ImportData(TBinaryTree& Data)
{
// Import Header
Data.ImportData("Header", m_HeaderData );
// Import audio data
TPtr<TBinaryTree>& pAudioData = Data.GetChild("Audio");
if(!pAudioData)
{
TLDebug_Break("Unable to import audio header");
return SyncFalse;
}
pAudioData->ResetReadPos();
pAudioData->ReadAll(m_RawAudioData);
return SyncTrue;
}
//-------------------------------------------------------
// save asset data to binary data
//-------------------------------------------------------
SyncBool TAudio::ExportData(TBinaryTree& Data)
{
// write header
Data.ExportData("Header", m_HeaderData);
// write audio data
TPtr<TBinaryTree>& pAudioData = Data.AddChild("Audio");
if ( !pAudioData )
return SyncFalse;
pAudioData->Copy(RawAudioDataBinary());
return SyncTrue;
}
| [
"[email protected]"
] | [
[
[
1,
55
]
]
] |
c56688e2c1fc8475192c0910e2265a838c39ed84 | 191d4160cba9d00fce9041a1cc09f17b4b027df5 | /ZeroLag/ZeroLag/ZeroLag.cpp | 4598622078c9b879dab1b83ccd7474dc2904580c | [] | no_license | zapline/zero-lag | f71d35efd7b2f884566a45b5c1dc6c7eec6577dd | 1651f264c6d2dc64e4bdcb6529fb6280bbbfbcf4 | refs/heads/master | 2021-01-22T16:45:46.430952 | 2011-05-07T13:22:52 | 2011-05-07T13:22:52 | 32,774,187 | 3 | 2 | null | null | null | null | GB18030 | C++ | false | false | 1,962 | cpp | // ZeroLag.cpp : 定义应用程序的类行为。
//
#include "stdafx.h"
#include "ZeroLag.h"
#include "ZeroLagDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CZeroLagApp
BEGIN_MESSAGE_MAP(CZeroLagApp, CWinApp)
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()
// CZeroLagApp 构造
CZeroLagApp::CZeroLagApp()
{
// TODO: 在此处添加构造代码,
// 将所有重要的初始化放置在 InitInstance 中
}
// 唯一的一个 CZeroLagApp 对象
CZeroLagApp theApp;
// CZeroLagApp 初始化
BOOL CZeroLagApp::InitInstance()
{
// 如果一个运行在 Windows XP 上的应用程序清单指定要
// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
//则需要 InitCommonControlsEx()。否则,将无法创建窗口。
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// 将它设置为包括所有要在应用程序中使用的
// 公共控件类。
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
AfxEnableControlContainer();
// 标准初始化
// 如果未使用这些功能并希望减小
// 最终可执行文件的大小,则应移除下列
// 不需要的特定初始化例程
// 更改用于存储设置的注册表项
// TODO: 应适当修改该字符串,
// 例如修改为公司或组织名
SetRegistryKey(_T("应用程序向导生成的本地应用程序"));
CZeroLagDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: 在此处放置处理何时用“确定”来关闭
// 对话框的代码
}
else if (nResponse == IDCANCEL)
{
// TODO: 在此放置处理何时用“取消”来关闭
// 对话框的代码
}
// 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
// 而不是启动应用程序的消息泵。
return FALSE;
}
| [
"Administrator@PC-200201010241"
] | [
[
[
1,
78
]
]
] |
24349516b0f8c6f9bd3d90ec25507c01d3e337ae | 1ff9f78a9352b12ad34790a8fe521593f60b9d4f | /Template/Explosion.cpp | 196a51d0b2e81bab87f5d86ed335d9780cbe1217 | [] | no_license | SamOatesUniversity/Year-2---Game-Engine-Construction---Sams-Super-Space-Shooter | 33bd39b4d9bf43532a3a3a2386cef96f67132e1e | 46022bc40cee89be1c733d28f8bda9fac3fcad9b | refs/heads/master | 2021-01-20T08:48:41.912143 | 2011-01-19T23:52:25 | 2011-01-19T23:52:25 | 41,169,993 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 618 | cpp | #include "Explosion.h"
CExplosion::CExplosion(void)
{
}
CExplosion::~CExplosion(void)
{
}
void CExplosion::init( void )
{
m_iFrameCount = 8;
m_iActiveFrame = 0;
m_iWidth /= m_iFrameCount;
m_iX = -m_iWidth;
m_iY = -m_iHeight;
m_side = TSideNeutral;
m_isActive = false;
m_useLerp = false;
}
void CExplosion::update( void )
{
if( m_isActive )
{
m_iActiveFrame++;
if( m_iActiveFrame >= m_iFrameCount )
{
CSound::Instance().playSound( soundExplosion );
m_iX = -100;
m_isActive = false;
m_iActiveFrame = 0;
}
}
}
void CExplosion::kill( void )
{
} | [
"[email protected]"
] | [
[
[
1,
41
]
]
] |
f8d692bc8d19cc2cf06e26752221ee032db085c7 | e2e49023f5a82922cb9b134e93ae926ed69675a1 | /tools/aosdesigner/view/ToolboxView.hpp | 0fdca74b56842c8d6c21b2bbbf996cb12da5785b | [] | no_license | invy/mjklaim-freewindows | c93c867e93f0e2fe1d33f207306c0b9538ac61d6 | 30de8e3dfcde4e81a57e9059dfaf54c98cc1135b | refs/heads/master | 2021-01-10T10:21:51.579762 | 2011-12-12T18:56:43 | 2011-12-12T18:56:43 | 54,794,395 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 684 | hpp | #ifndef HGUARD_AOSD_VIEW_TOOLBOXVIEW_HPP__
#define HGUARD_AOSD_VIEW_TOOLBOXVIEW_HPP__
#pragma once
#include <QToolBox>
#include "view/EditionToolView.hpp"
namespace aosd
{
namespace view
{
/** Display tools for edition.
**/
class ToolboxView
: public EditionToolView
{
Q_OBJECT
public:
ToolboxView();
private:
void begin_edition_session( const core::EditionSession& edition_session ){}
void end_edition_session( const core::EditionSession& edition_session ){}
void connect_edition( const core::EditionSession& edition_session );
void disconnect_edition( const core::EditionSession& edition_session );
};
}
}
#endif
| [
"klaim@localhost"
] | [
[
[
1,
36
]
]
] |
59f8af5fe2b7d1ddb62119e61c1077b7daf6570a | f8bb83ac9abae656fc3347741c4c0b9752029c7a | /wrap/block24.cpp | aa2b71b8987e2cdaefa7c1842f3db59ad24df53b | [
"Apache-2.0"
] | permissive | rowhit/pyoa | 6d1c3f6bfba9daf2db4e1aacb2c15e8095bfae54 | 60b394ae20ccf2baf206b074f6ded21b04c2b0c9 | refs/heads/master | 2021-05-28T09:55:56.748751 | 2010-04-23T06:58:30 | 2010-04-23T06:58:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,181,437 | cpp |
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntAppDef_oaTrackPattern
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaTrackPattern_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntAppDef_oaTrackPattern_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaTrackPatternObject* self = (PyoaIntAppDef_oaTrackPatternObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntAppDef_oaTrackPattern)
{
PyParamoaIntAppDef_oaTrackPattern p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaTrackPattern_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntAppDef_oaTrackPattern, Choices are:\n"
" (oaIntAppDef_oaTrackPattern)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntAppDef_oaTrackPattern_tp_dealloc(PyoaIntAppDef_oaTrackPatternObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaTrackPattern_tp_repr(PyObject *ob)
{
PyParamoaIntAppDef_oaTrackPattern value;
int convert_status=PyoaIntAppDef_oaTrackPattern_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[48];
sprintf(buffer,"<oaIntAppDef_oaTrackPattern::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntAppDef_oaTrackPattern_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntAppDef_oaTrackPattern v1;
PyParamoaIntAppDef_oaTrackPattern v2;
int convert_status1=PyoaIntAppDef_oaTrackPattern_Convert(ob1,&v1);
int convert_status2=PyoaIntAppDef_oaTrackPattern_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaTrackPattern_Convert(PyObject* ob,PyParamoaIntAppDef_oaTrackPattern* result)
{
if (ob == NULL) return 1;
if (PyoaIntAppDef_oaTrackPattern_Check(ob)) {
result->SetData( (oaIntAppDef_oaTrackPattern**) ((PyoaIntAppDef_oaTrackPatternObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntAppDef_oaTrackPattern Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaTrackPattern_FromoaIntAppDef_oaTrackPattern(oaIntAppDef_oaTrackPattern** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntAppDef_oaTrackPattern* data=*value;
PyObject* bself = PyoaIntAppDef_oaTrackPattern_Type.tp_alloc(&PyoaIntAppDef_oaTrackPattern_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaTrackPatternObject* self = (PyoaIntAppDef_oaTrackPatternObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaTrackPattern_FromoaIntAppDef_oaTrackPattern(oaIntAppDef_oaTrackPattern* data)
{
if (data) {
PyObject* bself = PyoaIntAppDef_oaTrackPattern_Type.tp_alloc(&PyoaIntAppDef_oaTrackPattern_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaTrackPatternObject* self = (PyoaIntAppDef_oaTrackPatternObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaTrackPattern_get_doc[] =
"Class: oaIntAppDef_oaTrackPattern, Function: get\n"
" Paramegers: (oaTrackPattern)\n"
" Calls: oaInt4 get(const oaTrackPattern* object)\n"
" Signature: get|simple-oaInt4|cptr-oaTrackPattern,\n"
" This function returns the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaTrackPattern_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaTrackPattern data;
int convert_status=PyoaIntAppDef_oaTrackPattern_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaTrackPatternObject* self=(PyoaIntAppDef_oaTrackPatternObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaTrackPattern p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaTrackPattern_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaInt4 result= (data.DataCall()->get(p1.Data()));
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaTrackPattern_getDefault_doc[] =
"Class: oaIntAppDef_oaTrackPattern, Function: getDefault\n"
" Paramegers: ()\n"
" Calls: oaInt4 getDefault() const\n"
" Signature: getDefault|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the default value for this integer extension.\n"
;
static PyObject*
oaIntAppDef_oaTrackPattern_getDefault(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaTrackPattern data;
int convert_status=PyoaIntAppDef_oaTrackPattern_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaTrackPatternObject* self=(PyoaIntAppDef_oaTrackPatternObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->getDefault());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaTrackPattern_set_doc[] =
"Class: oaIntAppDef_oaTrackPattern, Function: set\n"
" Paramegers: (oaTrackPattern,oaInt4)\n"
" Calls: void set(oaTrackPattern* object,oaInt4 value)\n"
" Signature: set|void-void|ptr-oaTrackPattern,simple-oaInt4,\n"
" This function sets the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaTrackPattern_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaTrackPattern data;
int convert_status=PyoaIntAppDef_oaTrackPattern_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaTrackPatternObject* self=(PyoaIntAppDef_oaTrackPatternObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaTrackPattern p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaTrackPattern_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaTrackPattern_isNull_doc[] =
"Class: oaIntAppDef_oaTrackPattern, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntAppDef_oaTrackPattern_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaTrackPattern data;
int convert_status=PyoaIntAppDef_oaTrackPattern_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntAppDef_oaTrackPattern_assign_doc[] =
"Class: oaIntAppDef_oaTrackPattern, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntAppDef_oaTrackPattern_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaTrackPattern data;
int convert_status=PyoaIntAppDef_oaTrackPattern_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntAppDef_oaTrackPattern p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaTrackPattern_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaTrackPattern_methodlist[] = {
{"get",(PyCFunction)oaIntAppDef_oaTrackPattern_get,METH_VARARGS,oaIntAppDef_oaTrackPattern_get_doc},
{"getDefault",(PyCFunction)oaIntAppDef_oaTrackPattern_getDefault,METH_VARARGS,oaIntAppDef_oaTrackPattern_getDefault_doc},
{"set",(PyCFunction)oaIntAppDef_oaTrackPattern_set,METH_VARARGS,oaIntAppDef_oaTrackPattern_set_doc},
{"isNull",(PyCFunction)oaIntAppDef_oaTrackPattern_tp_isNull,METH_VARARGS,oaIntAppDef_oaTrackPattern_isNull_doc},
{"assign",(PyCFunction)oaIntAppDef_oaTrackPattern_tp_assign,METH_VARARGS,oaIntAppDef_oaTrackPattern_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaTrackPattern_doc[] =
"Class: oaIntAppDef_oaTrackPattern\n"
" The oaIntAppDef class implements an application-specific extension for a particular type of data in a database.\n"
" Once created, an integer field is added to each object of the specified dataType. The default value for this extension is INT_MAX. Applications can use the new field for whatever purpose is necessary.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaIntAppDef_oaTrackPattern)\n"
" Calls: (const oaIntAppDef_oaTrackPattern&)\n"
" Signature: oaIntAppDef_oaTrackPattern||cref-oaIntAppDef_oaTrackPattern,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntAppDef_oaTrackPattern_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntAppDef_oaTrackPattern",
sizeof(PyoaIntAppDef_oaTrackPatternObject),
0,
(destructor)oaIntAppDef_oaTrackPattern_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntAppDef_oaTrackPattern_tp_compare, /* tp_compare */
(reprfunc)oaIntAppDef_oaTrackPattern_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntAppDef_oaTrackPattern_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntAppDef_oaTrackPattern_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntAppDef_oaTrackPattern_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaTrackPattern_static_find_doc[] =
"Class: oaIntAppDef_oaTrackPattern, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaTrackPattern* find(const oaString& name)\n"
" Signature: find|ptr-oaIntAppDef_oaTrackPattern|cref-oaString,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaTrackPattern* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaIntAppDef_oaTrackPattern|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaIntAppDef_oaTrackPattern_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaTrackPatternp result= (oaIntAppDef_oaTrackPattern::find(p1.Data()));
return PyoaIntAppDef_oaTrackPattern_FromoaIntAppDef_oaTrackPattern(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaTrackPatternp result= (oaIntAppDef_oaTrackPattern::find(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaTrackPattern_FromoaIntAppDef_oaTrackPattern(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaTrackPattern, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaTrackPattern_static_get_doc[] =
"Class: oaIntAppDef_oaTrackPattern, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaTrackPattern* get(const oaString& name)\n"
" Signature: get|ptr-oaIntAppDef_oaTrackPattern|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4)\n"
" Calls: oaIntAppDef_oaTrackPattern* get(const oaString& name,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaTrackPattern|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaTrackPattern* get(const oaString& name,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaTrackPattern|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaTrackPattern* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaIntAppDef_oaTrackPattern|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4)\n"
" Calls: oaIntAppDef_oaTrackPattern* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaTrackPattern|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaTrackPattern* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaTrackPattern|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaIntAppDef_oaTrackPattern_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaTrackPatternp result= (oaIntAppDef_oaTrackPattern::get(p1.Data()));
return PyoaIntAppDef_oaTrackPattern_FromoaIntAppDef_oaTrackPattern(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4)
{
PyParamoaString p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
oaIntAppDef_oaTrackPatternp result= (oaIntAppDef_oaTrackPattern::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaTrackPattern_FromoaIntAppDef_oaTrackPattern(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaInt4 p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
oaIntAppDef_oaTrackPatternp result= (oaIntAppDef_oaTrackPattern::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaTrackPattern_FromoaIntAppDef_oaTrackPattern(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaTrackPatternp result= (oaIntAppDef_oaTrackPattern::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaTrackPattern_FromoaIntAppDef_oaTrackPattern(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaTrackPatternp result= (oaIntAppDef_oaTrackPattern::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaTrackPattern_FromoaIntAppDef_oaTrackPattern(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
PyParamoaBoolean p4;
if (PyArg_ParseTuple(args,"O&O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3,
&PyoaBoolean_Convert,&p4)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaTrackPatternp result= (oaIntAppDef_oaTrackPattern::get(p1.Data(),p2.Data(),p3.Data(),p4.Data()));
return PyoaIntAppDef_oaTrackPattern_FromoaIntAppDef_oaTrackPattern(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaTrackPattern, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaInt4)\n"
" (oaString,oaInt4,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaInt4)\n"
" (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaTrackPattern_staticmethodlist[] = {
{"static_find",(PyCFunction)oaIntAppDef_oaTrackPattern_static_find,METH_VARARGS,oaIntAppDef_oaTrackPattern_static_find_doc},
{"static_get",(PyCFunction)oaIntAppDef_oaTrackPattern_static_get,METH_VARARGS,oaIntAppDef_oaTrackPattern_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaTrackPattern_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntAppDef_oaTrackPattern_Type)<0) {
printf("** PyType_Ready failed for: oaIntAppDef_oaTrackPattern\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntAppDef_oaTrackPattern",
(PyObject*)(&PyoaIntAppDef_oaTrackPattern_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntAppDef_oaTrackPattern\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntAppDef_oaTrackPattern_Type.tp_dict;
for(method=oaIntAppDef_oaTrackPattern_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntAppDef_oaValue
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaValue_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntAppDef_oaValue_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaValueObject* self = (PyoaIntAppDef_oaValueObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntAppDef_oaValue)
{
PyParamoaIntAppDef_oaValue p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaValue_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntAppDef_oaValue, Choices are:\n"
" (oaIntAppDef_oaValue)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntAppDef_oaValue_tp_dealloc(PyoaIntAppDef_oaValueObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaValue_tp_repr(PyObject *ob)
{
PyParamoaIntAppDef_oaValue value;
int convert_status=PyoaIntAppDef_oaValue_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[41];
sprintf(buffer,"<oaIntAppDef_oaValue::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntAppDef_oaValue_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntAppDef_oaValue v1;
PyParamoaIntAppDef_oaValue v2;
int convert_status1=PyoaIntAppDef_oaValue_Convert(ob1,&v1);
int convert_status2=PyoaIntAppDef_oaValue_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaValue_Convert(PyObject* ob,PyParamoaIntAppDef_oaValue* result)
{
if (ob == NULL) return 1;
if (PyoaIntAppDef_oaValue_Check(ob)) {
result->SetData( (oaIntAppDef_oaValue**) ((PyoaIntAppDef_oaValueObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntAppDef_oaValue Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaValue_FromoaIntAppDef_oaValue(oaIntAppDef_oaValue** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntAppDef_oaValue* data=*value;
PyObject* bself = PyoaIntAppDef_oaValue_Type.tp_alloc(&PyoaIntAppDef_oaValue_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaValueObject* self = (PyoaIntAppDef_oaValueObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaValue_FromoaIntAppDef_oaValue(oaIntAppDef_oaValue* data)
{
if (data) {
PyObject* bself = PyoaIntAppDef_oaValue_Type.tp_alloc(&PyoaIntAppDef_oaValue_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaValueObject* self = (PyoaIntAppDef_oaValueObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaValue_get_doc[] =
"Class: oaIntAppDef_oaValue, Function: get\n"
" Paramegers: (oaValue)\n"
" Calls: oaInt4 get(const oaValue* object)\n"
" Signature: get|simple-oaInt4|cptr-oaValue,\n"
" This function returns the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaValue_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaValue data;
int convert_status=PyoaIntAppDef_oaValue_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaValueObject* self=(PyoaIntAppDef_oaValueObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaValue p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaValue_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaInt4 result= (data.DataCall()->get(p1.Data()));
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaValue_getDefault_doc[] =
"Class: oaIntAppDef_oaValue, Function: getDefault\n"
" Paramegers: ()\n"
" Calls: oaInt4 getDefault() const\n"
" Signature: getDefault|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the default value for this integer extension.\n"
;
static PyObject*
oaIntAppDef_oaValue_getDefault(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaValue data;
int convert_status=PyoaIntAppDef_oaValue_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaValueObject* self=(PyoaIntAppDef_oaValueObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->getDefault());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaValue_set_doc[] =
"Class: oaIntAppDef_oaValue, Function: set\n"
" Paramegers: (oaValue,oaInt4)\n"
" Calls: void set(oaValue* object,oaInt4 value)\n"
" Signature: set|void-void|ptr-oaValue,simple-oaInt4,\n"
" This function sets the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaValue_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaValue data;
int convert_status=PyoaIntAppDef_oaValue_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaValueObject* self=(PyoaIntAppDef_oaValueObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaValue p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaValue_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaValue_isNull_doc[] =
"Class: oaIntAppDef_oaValue, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntAppDef_oaValue_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaValue data;
int convert_status=PyoaIntAppDef_oaValue_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntAppDef_oaValue_assign_doc[] =
"Class: oaIntAppDef_oaValue, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntAppDef_oaValue_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaValue data;
int convert_status=PyoaIntAppDef_oaValue_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntAppDef_oaValue p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaValue_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaValue_methodlist[] = {
{"get",(PyCFunction)oaIntAppDef_oaValue_get,METH_VARARGS,oaIntAppDef_oaValue_get_doc},
{"getDefault",(PyCFunction)oaIntAppDef_oaValue_getDefault,METH_VARARGS,oaIntAppDef_oaValue_getDefault_doc},
{"set",(PyCFunction)oaIntAppDef_oaValue_set,METH_VARARGS,oaIntAppDef_oaValue_set_doc},
{"isNull",(PyCFunction)oaIntAppDef_oaValue_tp_isNull,METH_VARARGS,oaIntAppDef_oaValue_isNull_doc},
{"assign",(PyCFunction)oaIntAppDef_oaValue_tp_assign,METH_VARARGS,oaIntAppDef_oaValue_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaValue_doc[] =
"Class: oaIntAppDef_oaValue\n"
" The oaIntAppDef class implements an application-specific extension for a particular type of data in a database.\n"
" Once created, an integer field is added to each object of the specified dataType. The default value for this extension is INT_MAX. Applications can use the new field for whatever purpose is necessary.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaIntAppDef_oaValue)\n"
" Calls: (const oaIntAppDef_oaValue&)\n"
" Signature: oaIntAppDef_oaValue||cref-oaIntAppDef_oaValue,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntAppDef_oaValue_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntAppDef_oaValue",
sizeof(PyoaIntAppDef_oaValueObject),
0,
(destructor)oaIntAppDef_oaValue_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntAppDef_oaValue_tp_compare, /* tp_compare */
(reprfunc)oaIntAppDef_oaValue_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntAppDef_oaValue_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntAppDef_oaValue_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntAppDef_oaValue_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaValue_static_find_doc[] =
"Class: oaIntAppDef_oaValue, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaValue* find(const oaString& name)\n"
" Signature: find|ptr-oaIntAppDef_oaValue|cref-oaString,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaValue* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaIntAppDef_oaValue|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaIntAppDef_oaValue_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaValuep result= (oaIntAppDef_oaValue::find(p1.Data()));
return PyoaIntAppDef_oaValue_FromoaIntAppDef_oaValue(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaValuep result= (oaIntAppDef_oaValue::find(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaValue_FromoaIntAppDef_oaValue(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaValue, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaValue_static_get_doc[] =
"Class: oaIntAppDef_oaValue, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaValue* get(const oaString& name)\n"
" Signature: get|ptr-oaIntAppDef_oaValue|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4)\n"
" Calls: oaIntAppDef_oaValue* get(const oaString& name,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaValue|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaValue* get(const oaString& name,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaValue|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaValue* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaIntAppDef_oaValue|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4)\n"
" Calls: oaIntAppDef_oaValue* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaValue|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaValue* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaValue|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaIntAppDef_oaValue_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaValuep result= (oaIntAppDef_oaValue::get(p1.Data()));
return PyoaIntAppDef_oaValue_FromoaIntAppDef_oaValue(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4)
{
PyParamoaString p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
oaIntAppDef_oaValuep result= (oaIntAppDef_oaValue::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaValue_FromoaIntAppDef_oaValue(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaInt4 p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
oaIntAppDef_oaValuep result= (oaIntAppDef_oaValue::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaValue_FromoaIntAppDef_oaValue(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaValuep result= (oaIntAppDef_oaValue::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaValue_FromoaIntAppDef_oaValue(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaValuep result= (oaIntAppDef_oaValue::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaValue_FromoaIntAppDef_oaValue(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
PyParamoaBoolean p4;
if (PyArg_ParseTuple(args,"O&O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3,
&PyoaBoolean_Convert,&p4)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaValuep result= (oaIntAppDef_oaValue::get(p1.Data(),p2.Data(),p3.Data(),p4.Data()));
return PyoaIntAppDef_oaValue_FromoaIntAppDef_oaValue(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaValue, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaInt4)\n"
" (oaString,oaInt4,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaInt4)\n"
" (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaValue_staticmethodlist[] = {
{"static_find",(PyCFunction)oaIntAppDef_oaValue_static_find,METH_VARARGS,oaIntAppDef_oaValue_static_find_doc},
{"static_get",(PyCFunction)oaIntAppDef_oaValue_static_get,METH_VARARGS,oaIntAppDef_oaValue_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaValue_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntAppDef_oaValue_Type)<0) {
printf("** PyType_Ready failed for: oaIntAppDef_oaValue\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntAppDef_oaValue",
(PyObject*)(&PyoaIntAppDef_oaValue_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntAppDef_oaValue\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntAppDef_oaValue_Type.tp_dict;
for(method=oaIntAppDef_oaValue_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntAppDef_oaVectorInstDef
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaVectorInstDef_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntAppDef_oaVectorInstDef_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaVectorInstDefObject* self = (PyoaIntAppDef_oaVectorInstDefObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntAppDef_oaVectorInstDef)
{
PyParamoaIntAppDef_oaVectorInstDef p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaVectorInstDef_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntAppDef_oaVectorInstDef, Choices are:\n"
" (oaIntAppDef_oaVectorInstDef)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntAppDef_oaVectorInstDef_tp_dealloc(PyoaIntAppDef_oaVectorInstDefObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaVectorInstDef_tp_repr(PyObject *ob)
{
PyParamoaIntAppDef_oaVectorInstDef value;
int convert_status=PyoaIntAppDef_oaVectorInstDef_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[49];
sprintf(buffer,"<oaIntAppDef_oaVectorInstDef::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntAppDef_oaVectorInstDef_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntAppDef_oaVectorInstDef v1;
PyParamoaIntAppDef_oaVectorInstDef v2;
int convert_status1=PyoaIntAppDef_oaVectorInstDef_Convert(ob1,&v1);
int convert_status2=PyoaIntAppDef_oaVectorInstDef_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaVectorInstDef_Convert(PyObject* ob,PyParamoaIntAppDef_oaVectorInstDef* result)
{
if (ob == NULL) return 1;
if (PyoaIntAppDef_oaVectorInstDef_Check(ob)) {
result->SetData( (oaIntAppDef_oaVectorInstDef**) ((PyoaIntAppDef_oaVectorInstDefObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntAppDef_oaVectorInstDef Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaVectorInstDef_FromoaIntAppDef_oaVectorInstDef(oaIntAppDef_oaVectorInstDef** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntAppDef_oaVectorInstDef* data=*value;
PyObject* bself = PyoaIntAppDef_oaVectorInstDef_Type.tp_alloc(&PyoaIntAppDef_oaVectorInstDef_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaVectorInstDefObject* self = (PyoaIntAppDef_oaVectorInstDefObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaVectorInstDef_FromoaIntAppDef_oaVectorInstDef(oaIntAppDef_oaVectorInstDef* data)
{
if (data) {
PyObject* bself = PyoaIntAppDef_oaVectorInstDef_Type.tp_alloc(&PyoaIntAppDef_oaVectorInstDef_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaVectorInstDefObject* self = (PyoaIntAppDef_oaVectorInstDefObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaVectorInstDef_get_doc[] =
"Class: oaIntAppDef_oaVectorInstDef, Function: get\n"
" Paramegers: (oaVectorInstDef)\n"
" Calls: oaInt4 get(const oaVectorInstDef* object)\n"
" Signature: get|simple-oaInt4|cptr-oaVectorInstDef,\n"
" This function returns the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaVectorInstDef_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaVectorInstDef data;
int convert_status=PyoaIntAppDef_oaVectorInstDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaVectorInstDefObject* self=(PyoaIntAppDef_oaVectorInstDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaVectorInstDef p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaVectorInstDef_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaInt4 result= (data.DataCall()->get(p1.Data()));
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaVectorInstDef_getDefault_doc[] =
"Class: oaIntAppDef_oaVectorInstDef, Function: getDefault\n"
" Paramegers: ()\n"
" Calls: oaInt4 getDefault() const\n"
" Signature: getDefault|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the default value for this integer extension.\n"
;
static PyObject*
oaIntAppDef_oaVectorInstDef_getDefault(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaVectorInstDef data;
int convert_status=PyoaIntAppDef_oaVectorInstDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaVectorInstDefObject* self=(PyoaIntAppDef_oaVectorInstDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->getDefault());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaVectorInstDef_set_doc[] =
"Class: oaIntAppDef_oaVectorInstDef, Function: set\n"
" Paramegers: (oaVectorInstDef,oaInt4)\n"
" Calls: void set(oaVectorInstDef* object,oaInt4 value)\n"
" Signature: set|void-void|ptr-oaVectorInstDef,simple-oaInt4,\n"
" This function sets the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaVectorInstDef_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaVectorInstDef data;
int convert_status=PyoaIntAppDef_oaVectorInstDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaVectorInstDefObject* self=(PyoaIntAppDef_oaVectorInstDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaVectorInstDef p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaVectorInstDef_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaVectorInstDef_isNull_doc[] =
"Class: oaIntAppDef_oaVectorInstDef, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntAppDef_oaVectorInstDef_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaVectorInstDef data;
int convert_status=PyoaIntAppDef_oaVectorInstDef_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntAppDef_oaVectorInstDef_assign_doc[] =
"Class: oaIntAppDef_oaVectorInstDef, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntAppDef_oaVectorInstDef_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaVectorInstDef data;
int convert_status=PyoaIntAppDef_oaVectorInstDef_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntAppDef_oaVectorInstDef p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaVectorInstDef_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaVectorInstDef_methodlist[] = {
{"get",(PyCFunction)oaIntAppDef_oaVectorInstDef_get,METH_VARARGS,oaIntAppDef_oaVectorInstDef_get_doc},
{"getDefault",(PyCFunction)oaIntAppDef_oaVectorInstDef_getDefault,METH_VARARGS,oaIntAppDef_oaVectorInstDef_getDefault_doc},
{"set",(PyCFunction)oaIntAppDef_oaVectorInstDef_set,METH_VARARGS,oaIntAppDef_oaVectorInstDef_set_doc},
{"isNull",(PyCFunction)oaIntAppDef_oaVectorInstDef_tp_isNull,METH_VARARGS,oaIntAppDef_oaVectorInstDef_isNull_doc},
{"assign",(PyCFunction)oaIntAppDef_oaVectorInstDef_tp_assign,METH_VARARGS,oaIntAppDef_oaVectorInstDef_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaVectorInstDef_doc[] =
"Class: oaIntAppDef_oaVectorInstDef\n"
" The oaIntAppDef class implements an application-specific extension for a particular type of data in a database.\n"
" Once created, an integer field is added to each object of the specified dataType. The default value for this extension is INT_MAX. Applications can use the new field for whatever purpose is necessary.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaIntAppDef_oaVectorInstDef)\n"
" Calls: (const oaIntAppDef_oaVectorInstDef&)\n"
" Signature: oaIntAppDef_oaVectorInstDef||cref-oaIntAppDef_oaVectorInstDef,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntAppDef_oaVectorInstDef_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntAppDef_oaVectorInstDef",
sizeof(PyoaIntAppDef_oaVectorInstDefObject),
0,
(destructor)oaIntAppDef_oaVectorInstDef_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntAppDef_oaVectorInstDef_tp_compare, /* tp_compare */
(reprfunc)oaIntAppDef_oaVectorInstDef_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntAppDef_oaVectorInstDef_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntAppDef_oaVectorInstDef_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntAppDef_oaVectorInstDef_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaVectorInstDef_static_find_doc[] =
"Class: oaIntAppDef_oaVectorInstDef, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaVectorInstDef* find(const oaString& name)\n"
" Signature: find|ptr-oaIntAppDef_oaVectorInstDef|cref-oaString,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaVectorInstDef* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaIntAppDef_oaVectorInstDef|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaIntAppDef_oaVectorInstDef_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaVectorInstDefp result= (oaIntAppDef_oaVectorInstDef::find(p1.Data()));
return PyoaIntAppDef_oaVectorInstDef_FromoaIntAppDef_oaVectorInstDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaVectorInstDefp result= (oaIntAppDef_oaVectorInstDef::find(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaVectorInstDef_FromoaIntAppDef_oaVectorInstDef(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaVectorInstDef, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaVectorInstDef_static_get_doc[] =
"Class: oaIntAppDef_oaVectorInstDef, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaVectorInstDef* get(const oaString& name)\n"
" Signature: get|ptr-oaIntAppDef_oaVectorInstDef|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4)\n"
" Calls: oaIntAppDef_oaVectorInstDef* get(const oaString& name,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaVectorInstDef|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaVectorInstDef* get(const oaString& name,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaVectorInstDef|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaVectorInstDef* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaIntAppDef_oaVectorInstDef|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4)\n"
" Calls: oaIntAppDef_oaVectorInstDef* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaVectorInstDef|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaVectorInstDef* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaVectorInstDef|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaIntAppDef_oaVectorInstDef_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaVectorInstDefp result= (oaIntAppDef_oaVectorInstDef::get(p1.Data()));
return PyoaIntAppDef_oaVectorInstDef_FromoaIntAppDef_oaVectorInstDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4)
{
PyParamoaString p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
oaIntAppDef_oaVectorInstDefp result= (oaIntAppDef_oaVectorInstDef::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaVectorInstDef_FromoaIntAppDef_oaVectorInstDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaInt4 p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
oaIntAppDef_oaVectorInstDefp result= (oaIntAppDef_oaVectorInstDef::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaVectorInstDef_FromoaIntAppDef_oaVectorInstDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaVectorInstDefp result= (oaIntAppDef_oaVectorInstDef::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaVectorInstDef_FromoaIntAppDef_oaVectorInstDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaVectorInstDefp result= (oaIntAppDef_oaVectorInstDef::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaVectorInstDef_FromoaIntAppDef_oaVectorInstDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
PyParamoaBoolean p4;
if (PyArg_ParseTuple(args,"O&O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3,
&PyoaBoolean_Convert,&p4)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaVectorInstDefp result= (oaIntAppDef_oaVectorInstDef::get(p1.Data(),p2.Data(),p3.Data(),p4.Data()));
return PyoaIntAppDef_oaVectorInstDef_FromoaIntAppDef_oaVectorInstDef(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaVectorInstDef, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaInt4)\n"
" (oaString,oaInt4,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaInt4)\n"
" (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaVectorInstDef_staticmethodlist[] = {
{"static_find",(PyCFunction)oaIntAppDef_oaVectorInstDef_static_find,METH_VARARGS,oaIntAppDef_oaVectorInstDef_static_find_doc},
{"static_get",(PyCFunction)oaIntAppDef_oaVectorInstDef_static_get,METH_VARARGS,oaIntAppDef_oaVectorInstDef_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaVectorInstDef_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntAppDef_oaVectorInstDef_Type)<0) {
printf("** PyType_Ready failed for: oaIntAppDef_oaVectorInstDef\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntAppDef_oaVectorInstDef",
(PyObject*)(&PyoaIntAppDef_oaVectorInstDef_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntAppDef_oaVectorInstDef\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntAppDef_oaVectorInstDef_Type.tp_dict;
for(method=oaIntAppDef_oaVectorInstDef_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntAppDef_oaVia
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaVia_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntAppDef_oaVia_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaViaObject* self = (PyoaIntAppDef_oaViaObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntAppDef_oaVia)
{
PyParamoaIntAppDef_oaVia p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaVia_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntAppDef_oaVia, Choices are:\n"
" (oaIntAppDef_oaVia)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntAppDef_oaVia_tp_dealloc(PyoaIntAppDef_oaViaObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaVia_tp_repr(PyObject *ob)
{
PyParamoaIntAppDef_oaVia value;
int convert_status=PyoaIntAppDef_oaVia_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[39];
sprintf(buffer,"<oaIntAppDef_oaVia::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntAppDef_oaVia_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntAppDef_oaVia v1;
PyParamoaIntAppDef_oaVia v2;
int convert_status1=PyoaIntAppDef_oaVia_Convert(ob1,&v1);
int convert_status2=PyoaIntAppDef_oaVia_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaVia_Convert(PyObject* ob,PyParamoaIntAppDef_oaVia* result)
{
if (ob == NULL) return 1;
if (PyoaIntAppDef_oaVia_Check(ob)) {
result->SetData( (oaIntAppDef_oaVia**) ((PyoaIntAppDef_oaViaObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntAppDef_oaVia Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaVia_FromoaIntAppDef_oaVia(oaIntAppDef_oaVia** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntAppDef_oaVia* data=*value;
PyObject* bself = PyoaIntAppDef_oaVia_Type.tp_alloc(&PyoaIntAppDef_oaVia_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaViaObject* self = (PyoaIntAppDef_oaViaObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaVia_FromoaIntAppDef_oaVia(oaIntAppDef_oaVia* data)
{
if (data) {
PyObject* bself = PyoaIntAppDef_oaVia_Type.tp_alloc(&PyoaIntAppDef_oaVia_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaViaObject* self = (PyoaIntAppDef_oaViaObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaVia_get_doc[] =
"Class: oaIntAppDef_oaVia, Function: get\n"
" Paramegers: (oaVia)\n"
" Calls: oaInt4 get(const oaVia* object)\n"
" Signature: get|simple-oaInt4|cptr-oaVia,\n"
" This function returns the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaVia_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaVia data;
int convert_status=PyoaIntAppDef_oaVia_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaViaObject* self=(PyoaIntAppDef_oaViaObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaVia p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaVia_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaInt4 result= (data.DataCall()->get(p1.Data()));
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaVia_getDefault_doc[] =
"Class: oaIntAppDef_oaVia, Function: getDefault\n"
" Paramegers: ()\n"
" Calls: oaInt4 getDefault() const\n"
" Signature: getDefault|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the default value for this integer extension.\n"
;
static PyObject*
oaIntAppDef_oaVia_getDefault(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaVia data;
int convert_status=PyoaIntAppDef_oaVia_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaViaObject* self=(PyoaIntAppDef_oaViaObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->getDefault());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaVia_set_doc[] =
"Class: oaIntAppDef_oaVia, Function: set\n"
" Paramegers: (oaVia,oaInt4)\n"
" Calls: void set(oaVia* object,oaInt4 value)\n"
" Signature: set|void-void|ptr-oaVia,simple-oaInt4,\n"
" This function sets the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaVia_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaVia data;
int convert_status=PyoaIntAppDef_oaVia_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaViaObject* self=(PyoaIntAppDef_oaViaObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaVia p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaVia_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaVia_isNull_doc[] =
"Class: oaIntAppDef_oaVia, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntAppDef_oaVia_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaVia data;
int convert_status=PyoaIntAppDef_oaVia_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntAppDef_oaVia_assign_doc[] =
"Class: oaIntAppDef_oaVia, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntAppDef_oaVia_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaVia data;
int convert_status=PyoaIntAppDef_oaVia_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntAppDef_oaVia p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaVia_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaVia_methodlist[] = {
{"get",(PyCFunction)oaIntAppDef_oaVia_get,METH_VARARGS,oaIntAppDef_oaVia_get_doc},
{"getDefault",(PyCFunction)oaIntAppDef_oaVia_getDefault,METH_VARARGS,oaIntAppDef_oaVia_getDefault_doc},
{"set",(PyCFunction)oaIntAppDef_oaVia_set,METH_VARARGS,oaIntAppDef_oaVia_set_doc},
{"isNull",(PyCFunction)oaIntAppDef_oaVia_tp_isNull,METH_VARARGS,oaIntAppDef_oaVia_isNull_doc},
{"assign",(PyCFunction)oaIntAppDef_oaVia_tp_assign,METH_VARARGS,oaIntAppDef_oaVia_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaVia_doc[] =
"Class: oaIntAppDef_oaVia\n"
" The oaIntAppDef class implements an application-specific extension for a particular type of data in a database.\n"
" Once created, an integer field is added to each object of the specified dataType. The default value for this extension is INT_MAX. Applications can use the new field for whatever purpose is necessary.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaIntAppDef_oaVia)\n"
" Calls: (const oaIntAppDef_oaVia&)\n"
" Signature: oaIntAppDef_oaVia||cref-oaIntAppDef_oaVia,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntAppDef_oaVia_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntAppDef_oaVia",
sizeof(PyoaIntAppDef_oaViaObject),
0,
(destructor)oaIntAppDef_oaVia_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntAppDef_oaVia_tp_compare, /* tp_compare */
(reprfunc)oaIntAppDef_oaVia_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntAppDef_oaVia_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntAppDef_oaVia_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntAppDef_oaVia_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaVia_static_find_doc[] =
"Class: oaIntAppDef_oaVia, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaVia* find(const oaString& name)\n"
" Signature: find|ptr-oaIntAppDef_oaVia|cref-oaString,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaVia* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaIntAppDef_oaVia|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaIntAppDef_oaVia_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaViap result= (oaIntAppDef_oaVia::find(p1.Data()));
return PyoaIntAppDef_oaVia_FromoaIntAppDef_oaVia(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViap result= (oaIntAppDef_oaVia::find(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaVia_FromoaIntAppDef_oaVia(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaVia, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaVia_static_get_doc[] =
"Class: oaIntAppDef_oaVia, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaVia* get(const oaString& name)\n"
" Signature: get|ptr-oaIntAppDef_oaVia|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4)\n"
" Calls: oaIntAppDef_oaVia* get(const oaString& name,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaVia|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaVia* get(const oaString& name,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaVia|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaVia* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaIntAppDef_oaVia|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4)\n"
" Calls: oaIntAppDef_oaVia* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaVia|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaVia* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaVia|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaIntAppDef_oaVia_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaViap result= (oaIntAppDef_oaVia::get(p1.Data()));
return PyoaIntAppDef_oaVia_FromoaIntAppDef_oaVia(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4)
{
PyParamoaString p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
oaIntAppDef_oaViap result= (oaIntAppDef_oaVia::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaVia_FromoaIntAppDef_oaVia(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaInt4 p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
oaIntAppDef_oaViap result= (oaIntAppDef_oaVia::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaVia_FromoaIntAppDef_oaVia(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViap result= (oaIntAppDef_oaVia::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaVia_FromoaIntAppDef_oaVia(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViap result= (oaIntAppDef_oaVia::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaVia_FromoaIntAppDef_oaVia(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
PyParamoaBoolean p4;
if (PyArg_ParseTuple(args,"O&O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3,
&PyoaBoolean_Convert,&p4)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViap result= (oaIntAppDef_oaVia::get(p1.Data(),p2.Data(),p3.Data(),p4.Data()));
return PyoaIntAppDef_oaVia_FromoaIntAppDef_oaVia(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaVia, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaInt4)\n"
" (oaString,oaInt4,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaInt4)\n"
" (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaVia_staticmethodlist[] = {
{"static_find",(PyCFunction)oaIntAppDef_oaVia_static_find,METH_VARARGS,oaIntAppDef_oaVia_static_find_doc},
{"static_get",(PyCFunction)oaIntAppDef_oaVia_static_get,METH_VARARGS,oaIntAppDef_oaVia_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaVia_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntAppDef_oaVia_Type)<0) {
printf("** PyType_Ready failed for: oaIntAppDef_oaVia\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntAppDef_oaVia",
(PyObject*)(&PyoaIntAppDef_oaVia_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntAppDef_oaVia\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntAppDef_oaVia_Type.tp_dict;
for(method=oaIntAppDef_oaVia_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntAppDef_oaViaDef
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaViaDef_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntAppDef_oaViaDef_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaViaDefObject* self = (PyoaIntAppDef_oaViaDefObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntAppDef_oaViaDef)
{
PyParamoaIntAppDef_oaViaDef p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaViaDef_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntAppDef_oaViaDef, Choices are:\n"
" (oaIntAppDef_oaViaDef)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntAppDef_oaViaDef_tp_dealloc(PyoaIntAppDef_oaViaDefObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaViaDef_tp_repr(PyObject *ob)
{
PyParamoaIntAppDef_oaViaDef value;
int convert_status=PyoaIntAppDef_oaViaDef_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[42];
sprintf(buffer,"<oaIntAppDef_oaViaDef::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntAppDef_oaViaDef_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntAppDef_oaViaDef v1;
PyParamoaIntAppDef_oaViaDef v2;
int convert_status1=PyoaIntAppDef_oaViaDef_Convert(ob1,&v1);
int convert_status2=PyoaIntAppDef_oaViaDef_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaViaDef_Convert(PyObject* ob,PyParamoaIntAppDef_oaViaDef* result)
{
if (ob == NULL) return 1;
if (PyoaIntAppDef_oaViaDef_Check(ob)) {
result->SetData( (oaIntAppDef_oaViaDef**) ((PyoaIntAppDef_oaViaDefObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntAppDef_oaViaDef Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaViaDef_FromoaIntAppDef_oaViaDef(oaIntAppDef_oaViaDef** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntAppDef_oaViaDef* data=*value;
PyObject* bself = PyoaIntAppDef_oaViaDef_Type.tp_alloc(&PyoaIntAppDef_oaViaDef_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaViaDefObject* self = (PyoaIntAppDef_oaViaDefObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaViaDef_FromoaIntAppDef_oaViaDef(oaIntAppDef_oaViaDef* data)
{
if (data) {
PyObject* bself = PyoaIntAppDef_oaViaDef_Type.tp_alloc(&PyoaIntAppDef_oaViaDef_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaViaDefObject* self = (PyoaIntAppDef_oaViaDefObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaDef_get_doc[] =
"Class: oaIntAppDef_oaViaDef, Function: get\n"
" Paramegers: (oaViaDef)\n"
" Calls: oaInt4 get(const oaViaDef* object)\n"
" Signature: get|simple-oaInt4|cptr-oaViaDef,\n"
" This function returns the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaViaDef_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaViaDef data;
int convert_status=PyoaIntAppDef_oaViaDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaViaDefObject* self=(PyoaIntAppDef_oaViaDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaViaDef p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaViaDef_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaInt4 result= (data.DataCall()->get(p1.Data()));
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaDef_getDefault_doc[] =
"Class: oaIntAppDef_oaViaDef, Function: getDefault\n"
" Paramegers: ()\n"
" Calls: oaInt4 getDefault() const\n"
" Signature: getDefault|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the default value for this integer extension.\n"
;
static PyObject*
oaIntAppDef_oaViaDef_getDefault(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaViaDef data;
int convert_status=PyoaIntAppDef_oaViaDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaViaDefObject* self=(PyoaIntAppDef_oaViaDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->getDefault());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaDef_set_doc[] =
"Class: oaIntAppDef_oaViaDef, Function: set\n"
" Paramegers: (oaViaDef,oaInt4)\n"
" Calls: void set(oaViaDef* object,oaInt4 value)\n"
" Signature: set|void-void|ptr-oaViaDef,simple-oaInt4,\n"
" This function sets the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaViaDef_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaViaDef data;
int convert_status=PyoaIntAppDef_oaViaDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaViaDefObject* self=(PyoaIntAppDef_oaViaDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaViaDef p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaViaDef_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaDef_isNull_doc[] =
"Class: oaIntAppDef_oaViaDef, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntAppDef_oaViaDef_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaViaDef data;
int convert_status=PyoaIntAppDef_oaViaDef_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntAppDef_oaViaDef_assign_doc[] =
"Class: oaIntAppDef_oaViaDef, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntAppDef_oaViaDef_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaViaDef data;
int convert_status=PyoaIntAppDef_oaViaDef_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntAppDef_oaViaDef p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaViaDef_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaViaDef_methodlist[] = {
{"get",(PyCFunction)oaIntAppDef_oaViaDef_get,METH_VARARGS,oaIntAppDef_oaViaDef_get_doc},
{"getDefault",(PyCFunction)oaIntAppDef_oaViaDef_getDefault,METH_VARARGS,oaIntAppDef_oaViaDef_getDefault_doc},
{"set",(PyCFunction)oaIntAppDef_oaViaDef_set,METH_VARARGS,oaIntAppDef_oaViaDef_set_doc},
{"isNull",(PyCFunction)oaIntAppDef_oaViaDef_tp_isNull,METH_VARARGS,oaIntAppDef_oaViaDef_isNull_doc},
{"assign",(PyCFunction)oaIntAppDef_oaViaDef_tp_assign,METH_VARARGS,oaIntAppDef_oaViaDef_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaDef_doc[] =
"Class: oaIntAppDef_oaViaDef\n"
" The oaIntAppDef class implements an application-specific extension for a particular type of data in a database.\n"
" Once created, an integer field is added to each object of the specified dataType. The default value for this extension is INT_MAX. Applications can use the new field for whatever purpose is necessary.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaIntAppDef_oaViaDef)\n"
" Calls: (const oaIntAppDef_oaViaDef&)\n"
" Signature: oaIntAppDef_oaViaDef||cref-oaIntAppDef_oaViaDef,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntAppDef_oaViaDef_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntAppDef_oaViaDef",
sizeof(PyoaIntAppDef_oaViaDefObject),
0,
(destructor)oaIntAppDef_oaViaDef_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntAppDef_oaViaDef_tp_compare, /* tp_compare */
(reprfunc)oaIntAppDef_oaViaDef_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntAppDef_oaViaDef_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntAppDef_oaViaDef_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntAppDef_oaViaDef_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaDef_static_find_doc[] =
"Class: oaIntAppDef_oaViaDef, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaViaDef* find(const oaString& name)\n"
" Signature: find|ptr-oaIntAppDef_oaViaDef|cref-oaString,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaViaDef* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaIntAppDef_oaViaDef|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaIntAppDef_oaViaDef_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaViaDefp result= (oaIntAppDef_oaViaDef::find(p1.Data()));
return PyoaIntAppDef_oaViaDef_FromoaIntAppDef_oaViaDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViaDefp result= (oaIntAppDef_oaViaDef::find(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaViaDef_FromoaIntAppDef_oaViaDef(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaViaDef, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaDef_static_get_doc[] =
"Class: oaIntAppDef_oaViaDef, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaViaDef* get(const oaString& name)\n"
" Signature: get|ptr-oaIntAppDef_oaViaDef|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4)\n"
" Calls: oaIntAppDef_oaViaDef* get(const oaString& name,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaViaDef|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaViaDef* get(const oaString& name,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaViaDef|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaViaDef* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaIntAppDef_oaViaDef|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4)\n"
" Calls: oaIntAppDef_oaViaDef* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaViaDef|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaViaDef* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaViaDef|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaIntAppDef_oaViaDef_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaViaDefp result= (oaIntAppDef_oaViaDef::get(p1.Data()));
return PyoaIntAppDef_oaViaDef_FromoaIntAppDef_oaViaDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4)
{
PyParamoaString p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
oaIntAppDef_oaViaDefp result= (oaIntAppDef_oaViaDef::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaViaDef_FromoaIntAppDef_oaViaDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaInt4 p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
oaIntAppDef_oaViaDefp result= (oaIntAppDef_oaViaDef::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaViaDef_FromoaIntAppDef_oaViaDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViaDefp result= (oaIntAppDef_oaViaDef::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaViaDef_FromoaIntAppDef_oaViaDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViaDefp result= (oaIntAppDef_oaViaDef::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaViaDef_FromoaIntAppDef_oaViaDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
PyParamoaBoolean p4;
if (PyArg_ParseTuple(args,"O&O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3,
&PyoaBoolean_Convert,&p4)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViaDefp result= (oaIntAppDef_oaViaDef::get(p1.Data(),p2.Data(),p3.Data(),p4.Data()));
return PyoaIntAppDef_oaViaDef_FromoaIntAppDef_oaViaDef(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaViaDef, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaInt4)\n"
" (oaString,oaInt4,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaInt4)\n"
" (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaViaDef_staticmethodlist[] = {
{"static_find",(PyCFunction)oaIntAppDef_oaViaDef_static_find,METH_VARARGS,oaIntAppDef_oaViaDef_static_find_doc},
{"static_get",(PyCFunction)oaIntAppDef_oaViaDef_static_get,METH_VARARGS,oaIntAppDef_oaViaDef_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaViaDef_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntAppDef_oaViaDef_Type)<0) {
printf("** PyType_Ready failed for: oaIntAppDef_oaViaDef\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntAppDef_oaViaDef",
(PyObject*)(&PyoaIntAppDef_oaViaDef_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntAppDef_oaViaDef\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntAppDef_oaViaDef_Type.tp_dict;
for(method=oaIntAppDef_oaViaDef_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntAppDef_oaViaHeader
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaViaHeader_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntAppDef_oaViaHeader_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaViaHeaderObject* self = (PyoaIntAppDef_oaViaHeaderObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntAppDef_oaViaHeader)
{
PyParamoaIntAppDef_oaViaHeader p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaViaHeader_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntAppDef_oaViaHeader, Choices are:\n"
" (oaIntAppDef_oaViaHeader)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntAppDef_oaViaHeader_tp_dealloc(PyoaIntAppDef_oaViaHeaderObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaViaHeader_tp_repr(PyObject *ob)
{
PyParamoaIntAppDef_oaViaHeader value;
int convert_status=PyoaIntAppDef_oaViaHeader_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[45];
sprintf(buffer,"<oaIntAppDef_oaViaHeader::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntAppDef_oaViaHeader_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntAppDef_oaViaHeader v1;
PyParamoaIntAppDef_oaViaHeader v2;
int convert_status1=PyoaIntAppDef_oaViaHeader_Convert(ob1,&v1);
int convert_status2=PyoaIntAppDef_oaViaHeader_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaViaHeader_Convert(PyObject* ob,PyParamoaIntAppDef_oaViaHeader* result)
{
if (ob == NULL) return 1;
if (PyoaIntAppDef_oaViaHeader_Check(ob)) {
result->SetData( (oaIntAppDef_oaViaHeader**) ((PyoaIntAppDef_oaViaHeaderObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntAppDef_oaViaHeader Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaViaHeader_FromoaIntAppDef_oaViaHeader(oaIntAppDef_oaViaHeader** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntAppDef_oaViaHeader* data=*value;
PyObject* bself = PyoaIntAppDef_oaViaHeader_Type.tp_alloc(&PyoaIntAppDef_oaViaHeader_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaViaHeaderObject* self = (PyoaIntAppDef_oaViaHeaderObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaViaHeader_FromoaIntAppDef_oaViaHeader(oaIntAppDef_oaViaHeader* data)
{
if (data) {
PyObject* bself = PyoaIntAppDef_oaViaHeader_Type.tp_alloc(&PyoaIntAppDef_oaViaHeader_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaViaHeaderObject* self = (PyoaIntAppDef_oaViaHeaderObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaHeader_get_doc[] =
"Class: oaIntAppDef_oaViaHeader, Function: get\n"
" Paramegers: (oaViaHeader)\n"
" Calls: oaInt4 get(const oaViaHeader* object)\n"
" Signature: get|simple-oaInt4|cptr-oaViaHeader,\n"
" This function returns the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaViaHeader_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaViaHeader data;
int convert_status=PyoaIntAppDef_oaViaHeader_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaViaHeaderObject* self=(PyoaIntAppDef_oaViaHeaderObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaViaHeader p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaViaHeader_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaInt4 result= (data.DataCall()->get(p1.Data()));
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaHeader_getDefault_doc[] =
"Class: oaIntAppDef_oaViaHeader, Function: getDefault\n"
" Paramegers: ()\n"
" Calls: oaInt4 getDefault() const\n"
" Signature: getDefault|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the default value for this integer extension.\n"
;
static PyObject*
oaIntAppDef_oaViaHeader_getDefault(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaViaHeader data;
int convert_status=PyoaIntAppDef_oaViaHeader_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaViaHeaderObject* self=(PyoaIntAppDef_oaViaHeaderObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->getDefault());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaHeader_set_doc[] =
"Class: oaIntAppDef_oaViaHeader, Function: set\n"
" Paramegers: (oaViaHeader,oaInt4)\n"
" Calls: void set(oaViaHeader* object,oaInt4 value)\n"
" Signature: set|void-void|ptr-oaViaHeader,simple-oaInt4,\n"
" This function sets the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaViaHeader_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaViaHeader data;
int convert_status=PyoaIntAppDef_oaViaHeader_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaViaHeaderObject* self=(PyoaIntAppDef_oaViaHeaderObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaViaHeader p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaViaHeader_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaHeader_isNull_doc[] =
"Class: oaIntAppDef_oaViaHeader, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntAppDef_oaViaHeader_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaViaHeader data;
int convert_status=PyoaIntAppDef_oaViaHeader_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntAppDef_oaViaHeader_assign_doc[] =
"Class: oaIntAppDef_oaViaHeader, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntAppDef_oaViaHeader_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaViaHeader data;
int convert_status=PyoaIntAppDef_oaViaHeader_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntAppDef_oaViaHeader p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaViaHeader_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaViaHeader_methodlist[] = {
{"get",(PyCFunction)oaIntAppDef_oaViaHeader_get,METH_VARARGS,oaIntAppDef_oaViaHeader_get_doc},
{"getDefault",(PyCFunction)oaIntAppDef_oaViaHeader_getDefault,METH_VARARGS,oaIntAppDef_oaViaHeader_getDefault_doc},
{"set",(PyCFunction)oaIntAppDef_oaViaHeader_set,METH_VARARGS,oaIntAppDef_oaViaHeader_set_doc},
{"isNull",(PyCFunction)oaIntAppDef_oaViaHeader_tp_isNull,METH_VARARGS,oaIntAppDef_oaViaHeader_isNull_doc},
{"assign",(PyCFunction)oaIntAppDef_oaViaHeader_tp_assign,METH_VARARGS,oaIntAppDef_oaViaHeader_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaHeader_doc[] =
"Class: oaIntAppDef_oaViaHeader\n"
" The oaIntAppDef class implements an application-specific extension for a particular type of data in a database.\n"
" Once created, an integer field is added to each object of the specified dataType. The default value for this extension is INT_MAX. Applications can use the new field for whatever purpose is necessary.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaIntAppDef_oaViaHeader)\n"
" Calls: (const oaIntAppDef_oaViaHeader&)\n"
" Signature: oaIntAppDef_oaViaHeader||cref-oaIntAppDef_oaViaHeader,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntAppDef_oaViaHeader_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntAppDef_oaViaHeader",
sizeof(PyoaIntAppDef_oaViaHeaderObject),
0,
(destructor)oaIntAppDef_oaViaHeader_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntAppDef_oaViaHeader_tp_compare, /* tp_compare */
(reprfunc)oaIntAppDef_oaViaHeader_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntAppDef_oaViaHeader_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntAppDef_oaViaHeader_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntAppDef_oaViaHeader_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaHeader_static_find_doc[] =
"Class: oaIntAppDef_oaViaHeader, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaViaHeader* find(const oaString& name)\n"
" Signature: find|ptr-oaIntAppDef_oaViaHeader|cref-oaString,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaViaHeader* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaIntAppDef_oaViaHeader|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaIntAppDef_oaViaHeader_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaViaHeaderp result= (oaIntAppDef_oaViaHeader::find(p1.Data()));
return PyoaIntAppDef_oaViaHeader_FromoaIntAppDef_oaViaHeader(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViaHeaderp result= (oaIntAppDef_oaViaHeader::find(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaViaHeader_FromoaIntAppDef_oaViaHeader(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaViaHeader, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaHeader_static_get_doc[] =
"Class: oaIntAppDef_oaViaHeader, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaViaHeader* get(const oaString& name)\n"
" Signature: get|ptr-oaIntAppDef_oaViaHeader|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4)\n"
" Calls: oaIntAppDef_oaViaHeader* get(const oaString& name,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaViaHeader|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaViaHeader* get(const oaString& name,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaViaHeader|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaViaHeader* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaIntAppDef_oaViaHeader|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4)\n"
" Calls: oaIntAppDef_oaViaHeader* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaViaHeader|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaViaHeader* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaViaHeader|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaIntAppDef_oaViaHeader_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaViaHeaderp result= (oaIntAppDef_oaViaHeader::get(p1.Data()));
return PyoaIntAppDef_oaViaHeader_FromoaIntAppDef_oaViaHeader(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4)
{
PyParamoaString p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
oaIntAppDef_oaViaHeaderp result= (oaIntAppDef_oaViaHeader::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaViaHeader_FromoaIntAppDef_oaViaHeader(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaInt4 p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
oaIntAppDef_oaViaHeaderp result= (oaIntAppDef_oaViaHeader::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaViaHeader_FromoaIntAppDef_oaViaHeader(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViaHeaderp result= (oaIntAppDef_oaViaHeader::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaViaHeader_FromoaIntAppDef_oaViaHeader(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViaHeaderp result= (oaIntAppDef_oaViaHeader::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaViaHeader_FromoaIntAppDef_oaViaHeader(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
PyParamoaBoolean p4;
if (PyArg_ParseTuple(args,"O&O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3,
&PyoaBoolean_Convert,&p4)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViaHeaderp result= (oaIntAppDef_oaViaHeader::get(p1.Data(),p2.Data(),p3.Data(),p4.Data()));
return PyoaIntAppDef_oaViaHeader_FromoaIntAppDef_oaViaHeader(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaViaHeader, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaInt4)\n"
" (oaString,oaInt4,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaInt4)\n"
" (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaViaHeader_staticmethodlist[] = {
{"static_find",(PyCFunction)oaIntAppDef_oaViaHeader_static_find,METH_VARARGS,oaIntAppDef_oaViaHeader_static_find_doc},
{"static_get",(PyCFunction)oaIntAppDef_oaViaHeader_static_get,METH_VARARGS,oaIntAppDef_oaViaHeader_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaViaHeader_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntAppDef_oaViaHeader_Type)<0) {
printf("** PyType_Ready failed for: oaIntAppDef_oaViaHeader\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntAppDef_oaViaHeader",
(PyObject*)(&PyoaIntAppDef_oaViaHeader_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntAppDef_oaViaHeader\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntAppDef_oaViaHeader_Type.tp_dict;
for(method=oaIntAppDef_oaViaHeader_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntAppDef_oaViaSpec
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaViaSpec_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntAppDef_oaViaSpec_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaViaSpecObject* self = (PyoaIntAppDef_oaViaSpecObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntAppDef_oaViaSpec)
{
PyParamoaIntAppDef_oaViaSpec p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaViaSpec_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntAppDef_oaViaSpec, Choices are:\n"
" (oaIntAppDef_oaViaSpec)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntAppDef_oaViaSpec_tp_dealloc(PyoaIntAppDef_oaViaSpecObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaViaSpec_tp_repr(PyObject *ob)
{
PyParamoaIntAppDef_oaViaSpec value;
int convert_status=PyoaIntAppDef_oaViaSpec_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[43];
sprintf(buffer,"<oaIntAppDef_oaViaSpec::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntAppDef_oaViaSpec_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntAppDef_oaViaSpec v1;
PyParamoaIntAppDef_oaViaSpec v2;
int convert_status1=PyoaIntAppDef_oaViaSpec_Convert(ob1,&v1);
int convert_status2=PyoaIntAppDef_oaViaSpec_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaViaSpec_Convert(PyObject* ob,PyParamoaIntAppDef_oaViaSpec* result)
{
if (ob == NULL) return 1;
if (PyoaIntAppDef_oaViaSpec_Check(ob)) {
result->SetData( (oaIntAppDef_oaViaSpec**) ((PyoaIntAppDef_oaViaSpecObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntAppDef_oaViaSpec Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaViaSpec_FromoaIntAppDef_oaViaSpec(oaIntAppDef_oaViaSpec** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntAppDef_oaViaSpec* data=*value;
PyObject* bself = PyoaIntAppDef_oaViaSpec_Type.tp_alloc(&PyoaIntAppDef_oaViaSpec_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaViaSpecObject* self = (PyoaIntAppDef_oaViaSpecObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaViaSpec_FromoaIntAppDef_oaViaSpec(oaIntAppDef_oaViaSpec* data)
{
if (data) {
PyObject* bself = PyoaIntAppDef_oaViaSpec_Type.tp_alloc(&PyoaIntAppDef_oaViaSpec_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaViaSpecObject* self = (PyoaIntAppDef_oaViaSpecObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaSpec_get_doc[] =
"Class: oaIntAppDef_oaViaSpec, Function: get\n"
" Paramegers: (oaViaSpec)\n"
" Calls: oaInt4 get(const oaViaSpec* object)\n"
" Signature: get|simple-oaInt4|cptr-oaViaSpec,\n"
" This function returns the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaViaSpec_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaViaSpec data;
int convert_status=PyoaIntAppDef_oaViaSpec_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaViaSpecObject* self=(PyoaIntAppDef_oaViaSpecObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaViaSpec p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaViaSpec_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaInt4 result= (data.DataCall()->get(p1.Data()));
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaSpec_getDefault_doc[] =
"Class: oaIntAppDef_oaViaSpec, Function: getDefault\n"
" Paramegers: ()\n"
" Calls: oaInt4 getDefault() const\n"
" Signature: getDefault|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the default value for this integer extension.\n"
;
static PyObject*
oaIntAppDef_oaViaSpec_getDefault(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaViaSpec data;
int convert_status=PyoaIntAppDef_oaViaSpec_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaViaSpecObject* self=(PyoaIntAppDef_oaViaSpecObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->getDefault());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaSpec_set_doc[] =
"Class: oaIntAppDef_oaViaSpec, Function: set\n"
" Paramegers: (oaViaSpec,oaInt4)\n"
" Calls: void set(oaViaSpec* object,oaInt4 value)\n"
" Signature: set|void-void|ptr-oaViaSpec,simple-oaInt4,\n"
" This function sets the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaViaSpec_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaViaSpec data;
int convert_status=PyoaIntAppDef_oaViaSpec_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaViaSpecObject* self=(PyoaIntAppDef_oaViaSpecObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaViaSpec p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaViaSpec_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaSpec_isNull_doc[] =
"Class: oaIntAppDef_oaViaSpec, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntAppDef_oaViaSpec_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaViaSpec data;
int convert_status=PyoaIntAppDef_oaViaSpec_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntAppDef_oaViaSpec_assign_doc[] =
"Class: oaIntAppDef_oaViaSpec, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntAppDef_oaViaSpec_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaViaSpec data;
int convert_status=PyoaIntAppDef_oaViaSpec_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntAppDef_oaViaSpec p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaViaSpec_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaViaSpec_methodlist[] = {
{"get",(PyCFunction)oaIntAppDef_oaViaSpec_get,METH_VARARGS,oaIntAppDef_oaViaSpec_get_doc},
{"getDefault",(PyCFunction)oaIntAppDef_oaViaSpec_getDefault,METH_VARARGS,oaIntAppDef_oaViaSpec_getDefault_doc},
{"set",(PyCFunction)oaIntAppDef_oaViaSpec_set,METH_VARARGS,oaIntAppDef_oaViaSpec_set_doc},
{"isNull",(PyCFunction)oaIntAppDef_oaViaSpec_tp_isNull,METH_VARARGS,oaIntAppDef_oaViaSpec_isNull_doc},
{"assign",(PyCFunction)oaIntAppDef_oaViaSpec_tp_assign,METH_VARARGS,oaIntAppDef_oaViaSpec_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaSpec_doc[] =
"Class: oaIntAppDef_oaViaSpec\n"
" The oaIntAppDef class implements an application-specific extension for a particular type of data in a database.\n"
" Once created, an integer field is added to each object of the specified dataType. The default value for this extension is INT_MAX. Applications can use the new field for whatever purpose is necessary.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaIntAppDef_oaViaSpec)\n"
" Calls: (const oaIntAppDef_oaViaSpec&)\n"
" Signature: oaIntAppDef_oaViaSpec||cref-oaIntAppDef_oaViaSpec,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntAppDef_oaViaSpec_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntAppDef_oaViaSpec",
sizeof(PyoaIntAppDef_oaViaSpecObject),
0,
(destructor)oaIntAppDef_oaViaSpec_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntAppDef_oaViaSpec_tp_compare, /* tp_compare */
(reprfunc)oaIntAppDef_oaViaSpec_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntAppDef_oaViaSpec_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntAppDef_oaViaSpec_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntAppDef_oaViaSpec_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaSpec_static_find_doc[] =
"Class: oaIntAppDef_oaViaSpec, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaViaSpec* find(const oaString& name)\n"
" Signature: find|ptr-oaIntAppDef_oaViaSpec|cref-oaString,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaViaSpec* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaIntAppDef_oaViaSpec|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaIntAppDef_oaViaSpec_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaViaSpecp result= (oaIntAppDef_oaViaSpec::find(p1.Data()));
return PyoaIntAppDef_oaViaSpec_FromoaIntAppDef_oaViaSpec(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViaSpecp result= (oaIntAppDef_oaViaSpec::find(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaViaSpec_FromoaIntAppDef_oaViaSpec(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaViaSpec, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaViaSpec_static_get_doc[] =
"Class: oaIntAppDef_oaViaSpec, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaViaSpec* get(const oaString& name)\n"
" Signature: get|ptr-oaIntAppDef_oaViaSpec|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4)\n"
" Calls: oaIntAppDef_oaViaSpec* get(const oaString& name,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaViaSpec|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaViaSpec* get(const oaString& name,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaViaSpec|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaViaSpec* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaIntAppDef_oaViaSpec|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4)\n"
" Calls: oaIntAppDef_oaViaSpec* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaViaSpec|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaViaSpec* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaViaSpec|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaIntAppDef_oaViaSpec_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaViaSpecp result= (oaIntAppDef_oaViaSpec::get(p1.Data()));
return PyoaIntAppDef_oaViaSpec_FromoaIntAppDef_oaViaSpec(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4)
{
PyParamoaString p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
oaIntAppDef_oaViaSpecp result= (oaIntAppDef_oaViaSpec::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaViaSpec_FromoaIntAppDef_oaViaSpec(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaInt4 p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
oaIntAppDef_oaViaSpecp result= (oaIntAppDef_oaViaSpec::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaViaSpec_FromoaIntAppDef_oaViaSpec(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViaSpecp result= (oaIntAppDef_oaViaSpec::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaViaSpec_FromoaIntAppDef_oaViaSpec(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViaSpecp result= (oaIntAppDef_oaViaSpec::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaViaSpec_FromoaIntAppDef_oaViaSpec(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
PyParamoaBoolean p4;
if (PyArg_ParseTuple(args,"O&O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3,
&PyoaBoolean_Convert,&p4)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViaSpecp result= (oaIntAppDef_oaViaSpec::get(p1.Data(),p2.Data(),p3.Data(),p4.Data()));
return PyoaIntAppDef_oaViaSpec_FromoaIntAppDef_oaViaSpec(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaViaSpec, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaInt4)\n"
" (oaString,oaInt4,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaInt4)\n"
" (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaViaSpec_staticmethodlist[] = {
{"static_find",(PyCFunction)oaIntAppDef_oaViaSpec_static_find,METH_VARARGS,oaIntAppDef_oaViaSpec_static_find_doc},
{"static_get",(PyCFunction)oaIntAppDef_oaViaSpec_static_get,METH_VARARGS,oaIntAppDef_oaViaSpec_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaViaSpec_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntAppDef_oaViaSpec_Type)<0) {
printf("** PyType_Ready failed for: oaIntAppDef_oaViaSpec\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntAppDef_oaViaSpec",
(PyObject*)(&PyoaIntAppDef_oaViaSpec_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntAppDef_oaViaSpec\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntAppDef_oaViaSpec_Type.tp_dict;
for(method=oaIntAppDef_oaViaSpec_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntAppDef_oaView
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaView_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntAppDef_oaView_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaViewObject* self = (PyoaIntAppDef_oaViewObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntAppDef_oaView)
{
PyParamoaIntAppDef_oaView p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaView_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntAppDef_oaView, Choices are:\n"
" (oaIntAppDef_oaView)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntAppDef_oaView_tp_dealloc(PyoaIntAppDef_oaViewObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaView_tp_repr(PyObject *ob)
{
PyParamoaIntAppDef_oaView value;
int convert_status=PyoaIntAppDef_oaView_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[40];
sprintf(buffer,"<oaIntAppDef_oaView::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntAppDef_oaView_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntAppDef_oaView v1;
PyParamoaIntAppDef_oaView v2;
int convert_status1=PyoaIntAppDef_oaView_Convert(ob1,&v1);
int convert_status2=PyoaIntAppDef_oaView_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaView_Convert(PyObject* ob,PyParamoaIntAppDef_oaView* result)
{
if (ob == NULL) return 1;
if (PyoaIntAppDef_oaView_Check(ob)) {
result->SetData( (oaIntAppDef_oaView**) ((PyoaIntAppDef_oaViewObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntAppDef_oaView Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaView_FromoaIntAppDef_oaView(oaIntAppDef_oaView** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntAppDef_oaView* data=*value;
PyObject* bself = PyoaIntAppDef_oaView_Type.tp_alloc(&PyoaIntAppDef_oaView_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaViewObject* self = (PyoaIntAppDef_oaViewObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaView_FromoaIntAppDef_oaView(oaIntAppDef_oaView* data)
{
if (data) {
PyObject* bself = PyoaIntAppDef_oaView_Type.tp_alloc(&PyoaIntAppDef_oaView_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaViewObject* self = (PyoaIntAppDef_oaViewObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaView_get_doc[] =
"Class: oaIntAppDef_oaView, Function: get\n"
" Paramegers: (oaView)\n"
" Calls: oaInt4 get(const oaView* object)\n"
" Signature: get|simple-oaInt4|cptr-oaView,\n"
" This function returns the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaView_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaView data;
int convert_status=PyoaIntAppDef_oaView_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaViewObject* self=(PyoaIntAppDef_oaViewObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaView p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaView_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaInt4 result= (data.DataCall()->get(p1.Data()));
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaView_getDefault_doc[] =
"Class: oaIntAppDef_oaView, Function: getDefault\n"
" Paramegers: ()\n"
" Calls: oaInt4 getDefault() const\n"
" Signature: getDefault|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the default value for this integer extension.\n"
;
static PyObject*
oaIntAppDef_oaView_getDefault(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaView data;
int convert_status=PyoaIntAppDef_oaView_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaViewObject* self=(PyoaIntAppDef_oaViewObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->getDefault());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaView_set_doc[] =
"Class: oaIntAppDef_oaView, Function: set\n"
" Paramegers: (oaView,oaInt4)\n"
" Calls: void set(oaView* object,oaInt4 value)\n"
" Signature: set|void-void|ptr-oaView,simple-oaInt4,\n"
" This function sets the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaView_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaView data;
int convert_status=PyoaIntAppDef_oaView_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaViewObject* self=(PyoaIntAppDef_oaViewObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaView p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaView_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaView_isNull_doc[] =
"Class: oaIntAppDef_oaView, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntAppDef_oaView_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaView data;
int convert_status=PyoaIntAppDef_oaView_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntAppDef_oaView_assign_doc[] =
"Class: oaIntAppDef_oaView, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntAppDef_oaView_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaView data;
int convert_status=PyoaIntAppDef_oaView_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntAppDef_oaView p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaView_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaView_methodlist[] = {
{"get",(PyCFunction)oaIntAppDef_oaView_get,METH_VARARGS,oaIntAppDef_oaView_get_doc},
{"getDefault",(PyCFunction)oaIntAppDef_oaView_getDefault,METH_VARARGS,oaIntAppDef_oaView_getDefault_doc},
{"set",(PyCFunction)oaIntAppDef_oaView_set,METH_VARARGS,oaIntAppDef_oaView_set_doc},
{"isNull",(PyCFunction)oaIntAppDef_oaView_tp_isNull,METH_VARARGS,oaIntAppDef_oaView_isNull_doc},
{"assign",(PyCFunction)oaIntAppDef_oaView_tp_assign,METH_VARARGS,oaIntAppDef_oaView_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaView_doc[] =
"Class: oaIntAppDef_oaView\n"
" The oaIntAppDef class implements an application-specific extension for a particular type of data in a database.\n"
" Once created, an integer field is added to each object of the specified dataType. The default value for this extension is INT_MAX. Applications can use the new field for whatever purpose is necessary.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaIntAppDef_oaView)\n"
" Calls: (const oaIntAppDef_oaView&)\n"
" Signature: oaIntAppDef_oaView||cref-oaIntAppDef_oaView,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntAppDef_oaView_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntAppDef_oaView",
sizeof(PyoaIntAppDef_oaViewObject),
0,
(destructor)oaIntAppDef_oaView_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntAppDef_oaView_tp_compare, /* tp_compare */
(reprfunc)oaIntAppDef_oaView_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntAppDef_oaView_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntAppDef_oaView_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntAppDef_oaView_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaView_static_find_doc[] =
"Class: oaIntAppDef_oaView, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaView* find(const oaString& name)\n"
" Signature: find|ptr-oaIntAppDef_oaView|cref-oaString,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaView* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaIntAppDef_oaView|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaIntAppDef_oaView_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaViewp result= (oaIntAppDef_oaView::find(p1.Data()));
return PyoaIntAppDef_oaView_FromoaIntAppDef_oaView(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViewp result= (oaIntAppDef_oaView::find(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaView_FromoaIntAppDef_oaView(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaView, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaView_static_get_doc[] =
"Class: oaIntAppDef_oaView, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaView* get(const oaString& name)\n"
" Signature: get|ptr-oaIntAppDef_oaView|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4)\n"
" Calls: oaIntAppDef_oaView* get(const oaString& name,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaView|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaView* get(const oaString& name,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaView|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaView* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaIntAppDef_oaView|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4)\n"
" Calls: oaIntAppDef_oaView* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaView|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaView* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaView|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaIntAppDef_oaView_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaViewp result= (oaIntAppDef_oaView::get(p1.Data()));
return PyoaIntAppDef_oaView_FromoaIntAppDef_oaView(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4)
{
PyParamoaString p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
oaIntAppDef_oaViewp result= (oaIntAppDef_oaView::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaView_FromoaIntAppDef_oaView(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaInt4 p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
oaIntAppDef_oaViewp result= (oaIntAppDef_oaView::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaView_FromoaIntAppDef_oaView(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViewp result= (oaIntAppDef_oaView::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaView_FromoaIntAppDef_oaView(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViewp result= (oaIntAppDef_oaView::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaView_FromoaIntAppDef_oaView(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
PyParamoaBoolean p4;
if (PyArg_ParseTuple(args,"O&O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3,
&PyoaBoolean_Convert,&p4)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaViewp result= (oaIntAppDef_oaView::get(p1.Data(),p2.Data(),p3.Data(),p4.Data()));
return PyoaIntAppDef_oaView_FromoaIntAppDef_oaView(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaView, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaInt4)\n"
" (oaString,oaInt4,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaInt4)\n"
" (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaView_staticmethodlist[] = {
{"static_find",(PyCFunction)oaIntAppDef_oaView_static_find,METH_VARARGS,oaIntAppDef_oaView_static_find_doc},
{"static_get",(PyCFunction)oaIntAppDef_oaView_static_get,METH_VARARGS,oaIntAppDef_oaView_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaView_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntAppDef_oaView_Type)<0) {
printf("** PyType_Ready failed for: oaIntAppDef_oaView\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntAppDef_oaView",
(PyObject*)(&PyoaIntAppDef_oaView_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntAppDef_oaView\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntAppDef_oaView_Type.tp_dict;
for(method=oaIntAppDef_oaView_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntAppDef_oaWafer
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaWafer_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntAppDef_oaWafer_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaWaferObject* self = (PyoaIntAppDef_oaWaferObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntAppDef_oaWafer)
{
PyParamoaIntAppDef_oaWafer p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaWafer_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntAppDef_oaWafer, Choices are:\n"
" (oaIntAppDef_oaWafer)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntAppDef_oaWafer_tp_dealloc(PyoaIntAppDef_oaWaferObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaWafer_tp_repr(PyObject *ob)
{
PyParamoaIntAppDef_oaWafer value;
int convert_status=PyoaIntAppDef_oaWafer_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[41];
sprintf(buffer,"<oaIntAppDef_oaWafer::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntAppDef_oaWafer_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntAppDef_oaWafer v1;
PyParamoaIntAppDef_oaWafer v2;
int convert_status1=PyoaIntAppDef_oaWafer_Convert(ob1,&v1);
int convert_status2=PyoaIntAppDef_oaWafer_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaWafer_Convert(PyObject* ob,PyParamoaIntAppDef_oaWafer* result)
{
if (ob == NULL) return 1;
if (PyoaIntAppDef_oaWafer_Check(ob)) {
result->SetData( (oaIntAppDef_oaWafer**) ((PyoaIntAppDef_oaWaferObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntAppDef_oaWafer Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaWafer_FromoaIntAppDef_oaWafer(oaIntAppDef_oaWafer** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntAppDef_oaWafer* data=*value;
PyObject* bself = PyoaIntAppDef_oaWafer_Type.tp_alloc(&PyoaIntAppDef_oaWafer_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaWaferObject* self = (PyoaIntAppDef_oaWaferObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaWafer_FromoaIntAppDef_oaWafer(oaIntAppDef_oaWafer* data)
{
if (data) {
PyObject* bself = PyoaIntAppDef_oaWafer_Type.tp_alloc(&PyoaIntAppDef_oaWafer_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaWaferObject* self = (PyoaIntAppDef_oaWaferObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaWafer_get_doc[] =
"Class: oaIntAppDef_oaWafer, Function: get\n"
" Paramegers: (oaWafer)\n"
" Calls: oaInt4 get(const oaWafer* object)\n"
" Signature: get|simple-oaInt4|cptr-oaWafer,\n"
" This function returns the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaWafer_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaWafer data;
int convert_status=PyoaIntAppDef_oaWafer_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaWaferObject* self=(PyoaIntAppDef_oaWaferObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaWafer p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaWafer_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaInt4 result= (data.DataCall()->get(p1.Data()));
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaWafer_getDefault_doc[] =
"Class: oaIntAppDef_oaWafer, Function: getDefault\n"
" Paramegers: ()\n"
" Calls: oaInt4 getDefault() const\n"
" Signature: getDefault|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the default value for this integer extension.\n"
;
static PyObject*
oaIntAppDef_oaWafer_getDefault(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaWafer data;
int convert_status=PyoaIntAppDef_oaWafer_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaWaferObject* self=(PyoaIntAppDef_oaWaferObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->getDefault());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaWafer_set_doc[] =
"Class: oaIntAppDef_oaWafer, Function: set\n"
" Paramegers: (oaWafer,oaInt4)\n"
" Calls: void set(oaWafer* object,oaInt4 value)\n"
" Signature: set|void-void|ptr-oaWafer,simple-oaInt4,\n"
" This function sets the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaWafer_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaWafer data;
int convert_status=PyoaIntAppDef_oaWafer_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaWaferObject* self=(PyoaIntAppDef_oaWaferObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaWafer p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaWafer_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaWafer_isNull_doc[] =
"Class: oaIntAppDef_oaWafer, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntAppDef_oaWafer_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaWafer data;
int convert_status=PyoaIntAppDef_oaWafer_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntAppDef_oaWafer_assign_doc[] =
"Class: oaIntAppDef_oaWafer, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntAppDef_oaWafer_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaWafer data;
int convert_status=PyoaIntAppDef_oaWafer_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntAppDef_oaWafer p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaWafer_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaWafer_methodlist[] = {
{"get",(PyCFunction)oaIntAppDef_oaWafer_get,METH_VARARGS,oaIntAppDef_oaWafer_get_doc},
{"getDefault",(PyCFunction)oaIntAppDef_oaWafer_getDefault,METH_VARARGS,oaIntAppDef_oaWafer_getDefault_doc},
{"set",(PyCFunction)oaIntAppDef_oaWafer_set,METH_VARARGS,oaIntAppDef_oaWafer_set_doc},
{"isNull",(PyCFunction)oaIntAppDef_oaWafer_tp_isNull,METH_VARARGS,oaIntAppDef_oaWafer_isNull_doc},
{"assign",(PyCFunction)oaIntAppDef_oaWafer_tp_assign,METH_VARARGS,oaIntAppDef_oaWafer_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaWafer_doc[] =
"Class: oaIntAppDef_oaWafer\n"
" The oaIntAppDef class implements an application-specific extension for a particular type of data in a database.\n"
" Once created, an integer field is added to each object of the specified dataType. The default value for this extension is INT_MAX. Applications can use the new field for whatever purpose is necessary.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaIntAppDef_oaWafer)\n"
" Calls: (const oaIntAppDef_oaWafer&)\n"
" Signature: oaIntAppDef_oaWafer||cref-oaIntAppDef_oaWafer,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntAppDef_oaWafer_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntAppDef_oaWafer",
sizeof(PyoaIntAppDef_oaWaferObject),
0,
(destructor)oaIntAppDef_oaWafer_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntAppDef_oaWafer_tp_compare, /* tp_compare */
(reprfunc)oaIntAppDef_oaWafer_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntAppDef_oaWafer_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntAppDef_oaWafer_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntAppDef_oaWafer_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaWafer_static_find_doc[] =
"Class: oaIntAppDef_oaWafer, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaWafer* find(const oaString& name)\n"
" Signature: find|ptr-oaIntAppDef_oaWafer|cref-oaString,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaWafer* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaIntAppDef_oaWafer|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaIntAppDef_oaWafer_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaWaferp result= (oaIntAppDef_oaWafer::find(p1.Data()));
return PyoaIntAppDef_oaWafer_FromoaIntAppDef_oaWafer(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaWaferp result= (oaIntAppDef_oaWafer::find(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaWafer_FromoaIntAppDef_oaWafer(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaWafer, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaWafer_static_get_doc[] =
"Class: oaIntAppDef_oaWafer, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaWafer* get(const oaString& name)\n"
" Signature: get|ptr-oaIntAppDef_oaWafer|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4)\n"
" Calls: oaIntAppDef_oaWafer* get(const oaString& name,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaWafer|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaWafer* get(const oaString& name,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaWafer|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaWafer* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaIntAppDef_oaWafer|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4)\n"
" Calls: oaIntAppDef_oaWafer* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaWafer|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaWafer* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaWafer|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaIntAppDef_oaWafer_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaWaferp result= (oaIntAppDef_oaWafer::get(p1.Data()));
return PyoaIntAppDef_oaWafer_FromoaIntAppDef_oaWafer(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4)
{
PyParamoaString p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
oaIntAppDef_oaWaferp result= (oaIntAppDef_oaWafer::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaWafer_FromoaIntAppDef_oaWafer(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaInt4 p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
oaIntAppDef_oaWaferp result= (oaIntAppDef_oaWafer::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaWafer_FromoaIntAppDef_oaWafer(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaWaferp result= (oaIntAppDef_oaWafer::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaWafer_FromoaIntAppDef_oaWafer(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaWaferp result= (oaIntAppDef_oaWafer::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaWafer_FromoaIntAppDef_oaWafer(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
PyParamoaBoolean p4;
if (PyArg_ParseTuple(args,"O&O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3,
&PyoaBoolean_Convert,&p4)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaWaferp result= (oaIntAppDef_oaWafer::get(p1.Data(),p2.Data(),p3.Data(),p4.Data()));
return PyoaIntAppDef_oaWafer_FromoaIntAppDef_oaWafer(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaWafer, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaInt4)\n"
" (oaString,oaInt4,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaInt4)\n"
" (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaWafer_staticmethodlist[] = {
{"static_find",(PyCFunction)oaIntAppDef_oaWafer_static_find,METH_VARARGS,oaIntAppDef_oaWafer_static_find_doc},
{"static_get",(PyCFunction)oaIntAppDef_oaWafer_static_get,METH_VARARGS,oaIntAppDef_oaWafer_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaWafer_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntAppDef_oaWafer_Type)<0) {
printf("** PyType_Ready failed for: oaIntAppDef_oaWafer\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntAppDef_oaWafer",
(PyObject*)(&PyoaIntAppDef_oaWafer_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntAppDef_oaWafer\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntAppDef_oaWafer_Type.tp_dict;
for(method=oaIntAppDef_oaWafer_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntAppDef_oaWaferDesc
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaWaferDesc_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntAppDef_oaWaferDesc_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaWaferDescObject* self = (PyoaIntAppDef_oaWaferDescObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntAppDef_oaWaferDesc)
{
PyParamoaIntAppDef_oaWaferDesc p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaWaferDesc_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntAppDef_oaWaferDesc, Choices are:\n"
" (oaIntAppDef_oaWaferDesc)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntAppDef_oaWaferDesc_tp_dealloc(PyoaIntAppDef_oaWaferDescObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaWaferDesc_tp_repr(PyObject *ob)
{
PyParamoaIntAppDef_oaWaferDesc value;
int convert_status=PyoaIntAppDef_oaWaferDesc_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[45];
sprintf(buffer,"<oaIntAppDef_oaWaferDesc::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntAppDef_oaWaferDesc_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntAppDef_oaWaferDesc v1;
PyParamoaIntAppDef_oaWaferDesc v2;
int convert_status1=PyoaIntAppDef_oaWaferDesc_Convert(ob1,&v1);
int convert_status2=PyoaIntAppDef_oaWaferDesc_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaWaferDesc_Convert(PyObject* ob,PyParamoaIntAppDef_oaWaferDesc* result)
{
if (ob == NULL) return 1;
if (PyoaIntAppDef_oaWaferDesc_Check(ob)) {
result->SetData( (oaIntAppDef_oaWaferDesc**) ((PyoaIntAppDef_oaWaferDescObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntAppDef_oaWaferDesc Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaWaferDesc_FromoaIntAppDef_oaWaferDesc(oaIntAppDef_oaWaferDesc** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntAppDef_oaWaferDesc* data=*value;
PyObject* bself = PyoaIntAppDef_oaWaferDesc_Type.tp_alloc(&PyoaIntAppDef_oaWaferDesc_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaWaferDescObject* self = (PyoaIntAppDef_oaWaferDescObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaWaferDesc_FromoaIntAppDef_oaWaferDesc(oaIntAppDef_oaWaferDesc* data)
{
if (data) {
PyObject* bself = PyoaIntAppDef_oaWaferDesc_Type.tp_alloc(&PyoaIntAppDef_oaWaferDesc_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaWaferDescObject* self = (PyoaIntAppDef_oaWaferDescObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaWaferDesc_get_doc[] =
"Class: oaIntAppDef_oaWaferDesc, Function: get\n"
" Paramegers: (oaWaferDesc)\n"
" Calls: oaInt4 get(const oaWaferDesc* object)\n"
" Signature: get|simple-oaInt4|cptr-oaWaferDesc,\n"
" This function returns the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaWaferDesc_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaWaferDesc data;
int convert_status=PyoaIntAppDef_oaWaferDesc_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaWaferDescObject* self=(PyoaIntAppDef_oaWaferDescObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaWaferDesc p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaWaferDesc_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaInt4 result= (data.DataCall()->get(p1.Data()));
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaWaferDesc_getDefault_doc[] =
"Class: oaIntAppDef_oaWaferDesc, Function: getDefault\n"
" Paramegers: ()\n"
" Calls: oaInt4 getDefault() const\n"
" Signature: getDefault|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the default value for this integer extension.\n"
;
static PyObject*
oaIntAppDef_oaWaferDesc_getDefault(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaWaferDesc data;
int convert_status=PyoaIntAppDef_oaWaferDesc_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaWaferDescObject* self=(PyoaIntAppDef_oaWaferDescObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->getDefault());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaWaferDesc_set_doc[] =
"Class: oaIntAppDef_oaWaferDesc, Function: set\n"
" Paramegers: (oaWaferDesc,oaInt4)\n"
" Calls: void set(oaWaferDesc* object,oaInt4 value)\n"
" Signature: set|void-void|ptr-oaWaferDesc,simple-oaInt4,\n"
" This function sets the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaWaferDesc_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaWaferDesc data;
int convert_status=PyoaIntAppDef_oaWaferDesc_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaWaferDescObject* self=(PyoaIntAppDef_oaWaferDescObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaWaferDesc p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaWaferDesc_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaWaferDesc_isNull_doc[] =
"Class: oaIntAppDef_oaWaferDesc, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntAppDef_oaWaferDesc_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaWaferDesc data;
int convert_status=PyoaIntAppDef_oaWaferDesc_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntAppDef_oaWaferDesc_assign_doc[] =
"Class: oaIntAppDef_oaWaferDesc, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntAppDef_oaWaferDesc_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaWaferDesc data;
int convert_status=PyoaIntAppDef_oaWaferDesc_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntAppDef_oaWaferDesc p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaWaferDesc_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaWaferDesc_methodlist[] = {
{"get",(PyCFunction)oaIntAppDef_oaWaferDesc_get,METH_VARARGS,oaIntAppDef_oaWaferDesc_get_doc},
{"getDefault",(PyCFunction)oaIntAppDef_oaWaferDesc_getDefault,METH_VARARGS,oaIntAppDef_oaWaferDesc_getDefault_doc},
{"set",(PyCFunction)oaIntAppDef_oaWaferDesc_set,METH_VARARGS,oaIntAppDef_oaWaferDesc_set_doc},
{"isNull",(PyCFunction)oaIntAppDef_oaWaferDesc_tp_isNull,METH_VARARGS,oaIntAppDef_oaWaferDesc_isNull_doc},
{"assign",(PyCFunction)oaIntAppDef_oaWaferDesc_tp_assign,METH_VARARGS,oaIntAppDef_oaWaferDesc_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaWaferDesc_doc[] =
"Class: oaIntAppDef_oaWaferDesc\n"
" The oaIntAppDef class implements an application-specific extension for a particular type of data in a database.\n"
" Once created, an integer field is added to each object of the specified dataType. The default value for this extension is INT_MAX. Applications can use the new field for whatever purpose is necessary.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaIntAppDef_oaWaferDesc)\n"
" Calls: (const oaIntAppDef_oaWaferDesc&)\n"
" Signature: oaIntAppDef_oaWaferDesc||cref-oaIntAppDef_oaWaferDesc,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntAppDef_oaWaferDesc_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntAppDef_oaWaferDesc",
sizeof(PyoaIntAppDef_oaWaferDescObject),
0,
(destructor)oaIntAppDef_oaWaferDesc_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntAppDef_oaWaferDesc_tp_compare, /* tp_compare */
(reprfunc)oaIntAppDef_oaWaferDesc_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntAppDef_oaWaferDesc_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntAppDef_oaWaferDesc_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntAppDef_oaWaferDesc_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaWaferDesc_static_find_doc[] =
"Class: oaIntAppDef_oaWaferDesc, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaWaferDesc* find(const oaString& name)\n"
" Signature: find|ptr-oaIntAppDef_oaWaferDesc|cref-oaString,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaWaferDesc* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaIntAppDef_oaWaferDesc|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaIntAppDef_oaWaferDesc_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaWaferDescp result= (oaIntAppDef_oaWaferDesc::find(p1.Data()));
return PyoaIntAppDef_oaWaferDesc_FromoaIntAppDef_oaWaferDesc(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaWaferDescp result= (oaIntAppDef_oaWaferDesc::find(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaWaferDesc_FromoaIntAppDef_oaWaferDesc(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaWaferDesc, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaWaferDesc_static_get_doc[] =
"Class: oaIntAppDef_oaWaferDesc, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaWaferDesc* get(const oaString& name)\n"
" Signature: get|ptr-oaIntAppDef_oaWaferDesc|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4)\n"
" Calls: oaIntAppDef_oaWaferDesc* get(const oaString& name,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaWaferDesc|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaWaferDesc* get(const oaString& name,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaWaferDesc|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaWaferDesc* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaIntAppDef_oaWaferDesc|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4)\n"
" Calls: oaIntAppDef_oaWaferDesc* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaWaferDesc|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaWaferDesc* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaWaferDesc|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaIntAppDef_oaWaferDesc_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaWaferDescp result= (oaIntAppDef_oaWaferDesc::get(p1.Data()));
return PyoaIntAppDef_oaWaferDesc_FromoaIntAppDef_oaWaferDesc(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4)
{
PyParamoaString p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
oaIntAppDef_oaWaferDescp result= (oaIntAppDef_oaWaferDesc::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaWaferDesc_FromoaIntAppDef_oaWaferDesc(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaInt4 p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
oaIntAppDef_oaWaferDescp result= (oaIntAppDef_oaWaferDesc::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaWaferDesc_FromoaIntAppDef_oaWaferDesc(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaWaferDescp result= (oaIntAppDef_oaWaferDesc::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaWaferDesc_FromoaIntAppDef_oaWaferDesc(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaWaferDescp result= (oaIntAppDef_oaWaferDesc::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaWaferDesc_FromoaIntAppDef_oaWaferDesc(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
PyParamoaBoolean p4;
if (PyArg_ParseTuple(args,"O&O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3,
&PyoaBoolean_Convert,&p4)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaWaferDescp result= (oaIntAppDef_oaWaferDesc::get(p1.Data(),p2.Data(),p3.Data(),p4.Data()));
return PyoaIntAppDef_oaWaferDesc_FromoaIntAppDef_oaWaferDesc(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaWaferDesc, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaInt4)\n"
" (oaString,oaInt4,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaInt4)\n"
" (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaWaferDesc_staticmethodlist[] = {
{"static_find",(PyCFunction)oaIntAppDef_oaWaferDesc_static_find,METH_VARARGS,oaIntAppDef_oaWaferDesc_static_find_doc},
{"static_get",(PyCFunction)oaIntAppDef_oaWaferDesc_static_get,METH_VARARGS,oaIntAppDef_oaWaferDesc_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaWaferDesc_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntAppDef_oaWaferDesc_Type)<0) {
printf("** PyType_Ready failed for: oaIntAppDef_oaWaferDesc\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntAppDef_oaWaferDesc",
(PyObject*)(&PyoaIntAppDef_oaWaferDesc_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntAppDef_oaWaferDesc\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntAppDef_oaWaferDesc_Type.tp_dict;
for(method=oaIntAppDef_oaWaferDesc_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntAppDef_oaWaferFeature
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaWaferFeature_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntAppDef_oaWaferFeature_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaWaferFeatureObject* self = (PyoaIntAppDef_oaWaferFeatureObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntAppDef_oaWaferFeature)
{
PyParamoaIntAppDef_oaWaferFeature p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaWaferFeature_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntAppDef_oaWaferFeature, Choices are:\n"
" (oaIntAppDef_oaWaferFeature)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntAppDef_oaWaferFeature_tp_dealloc(PyoaIntAppDef_oaWaferFeatureObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntAppDef_oaWaferFeature_tp_repr(PyObject *ob)
{
PyParamoaIntAppDef_oaWaferFeature value;
int convert_status=PyoaIntAppDef_oaWaferFeature_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[48];
sprintf(buffer,"<oaIntAppDef_oaWaferFeature::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntAppDef_oaWaferFeature_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntAppDef_oaWaferFeature v1;
PyParamoaIntAppDef_oaWaferFeature v2;
int convert_status1=PyoaIntAppDef_oaWaferFeature_Convert(ob1,&v1);
int convert_status2=PyoaIntAppDef_oaWaferFeature_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaWaferFeature_Convert(PyObject* ob,PyParamoaIntAppDef_oaWaferFeature* result)
{
if (ob == NULL) return 1;
if (PyoaIntAppDef_oaWaferFeature_Check(ob)) {
result->SetData( (oaIntAppDef_oaWaferFeature**) ((PyoaIntAppDef_oaWaferFeatureObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntAppDef_oaWaferFeature Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaWaferFeature_FromoaIntAppDef_oaWaferFeature(oaIntAppDef_oaWaferFeature** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntAppDef_oaWaferFeature* data=*value;
PyObject* bself = PyoaIntAppDef_oaWaferFeature_Type.tp_alloc(&PyoaIntAppDef_oaWaferFeature_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaWaferFeatureObject* self = (PyoaIntAppDef_oaWaferFeatureObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntAppDef_oaWaferFeature_FromoaIntAppDef_oaWaferFeature(oaIntAppDef_oaWaferFeature* data)
{
if (data) {
PyObject* bself = PyoaIntAppDef_oaWaferFeature_Type.tp_alloc(&PyoaIntAppDef_oaWaferFeature_Type,0);
if (bself == NULL) return bself;
PyoaIntAppDef_oaWaferFeatureObject* self = (PyoaIntAppDef_oaWaferFeatureObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaWaferFeature_get_doc[] =
"Class: oaIntAppDef_oaWaferFeature, Function: get\n"
" Paramegers: (oaWaferFeature)\n"
" Calls: oaInt4 get(const oaWaferFeature* object)\n"
" Signature: get|simple-oaInt4|cptr-oaWaferFeature,\n"
" This function returns the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaWaferFeature_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaWaferFeature data;
int convert_status=PyoaIntAppDef_oaWaferFeature_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaWaferFeatureObject* self=(PyoaIntAppDef_oaWaferFeatureObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaWaferFeature p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaWaferFeature_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaInt4 result= (data.DataCall()->get(p1.Data()));
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaWaferFeature_getDefault_doc[] =
"Class: oaIntAppDef_oaWaferFeature, Function: getDefault\n"
" Paramegers: ()\n"
" Calls: oaInt4 getDefault() const\n"
" Signature: getDefault|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the default value for this integer extension.\n"
;
static PyObject*
oaIntAppDef_oaWaferFeature_getDefault(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaWaferFeature data;
int convert_status=PyoaIntAppDef_oaWaferFeature_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaWaferFeatureObject* self=(PyoaIntAppDef_oaWaferFeatureObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->getDefault());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaWaferFeature_set_doc[] =
"Class: oaIntAppDef_oaWaferFeature, Function: set\n"
" Paramegers: (oaWaferFeature,oaInt4)\n"
" Calls: void set(oaWaferFeature* object,oaInt4 value)\n"
" Signature: set|void-void|ptr-oaWaferFeature,simple-oaInt4,\n"
" This function sets the value of this integer extension.\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaIntAppDef_oaWaferFeature_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntAppDef_oaWaferFeature data;
int convert_status=PyoaIntAppDef_oaWaferFeature_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntAppDef_oaWaferFeatureObject* self=(PyoaIntAppDef_oaWaferFeatureObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaWaferFeature p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaWaferFeature_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaWaferFeature_isNull_doc[] =
"Class: oaIntAppDef_oaWaferFeature, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntAppDef_oaWaferFeature_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaWaferFeature data;
int convert_status=PyoaIntAppDef_oaWaferFeature_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntAppDef_oaWaferFeature_assign_doc[] =
"Class: oaIntAppDef_oaWaferFeature, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntAppDef_oaWaferFeature_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntAppDef_oaWaferFeature data;
int convert_status=PyoaIntAppDef_oaWaferFeature_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntAppDef_oaWaferFeature p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntAppDef_oaWaferFeature_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaWaferFeature_methodlist[] = {
{"get",(PyCFunction)oaIntAppDef_oaWaferFeature_get,METH_VARARGS,oaIntAppDef_oaWaferFeature_get_doc},
{"getDefault",(PyCFunction)oaIntAppDef_oaWaferFeature_getDefault,METH_VARARGS,oaIntAppDef_oaWaferFeature_getDefault_doc},
{"set",(PyCFunction)oaIntAppDef_oaWaferFeature_set,METH_VARARGS,oaIntAppDef_oaWaferFeature_set_doc},
{"isNull",(PyCFunction)oaIntAppDef_oaWaferFeature_tp_isNull,METH_VARARGS,oaIntAppDef_oaWaferFeature_isNull_doc},
{"assign",(PyCFunction)oaIntAppDef_oaWaferFeature_tp_assign,METH_VARARGS,oaIntAppDef_oaWaferFeature_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaWaferFeature_doc[] =
"Class: oaIntAppDef_oaWaferFeature\n"
" The oaIntAppDef class implements an application-specific extension for a particular type of data in a database.\n"
" Once created, an integer field is added to each object of the specified dataType. The default value for this extension is INT_MAX. Applications can use the new field for whatever purpose is necessary.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaIntAppDef_oaWaferFeature)\n"
" Calls: (const oaIntAppDef_oaWaferFeature&)\n"
" Signature: oaIntAppDef_oaWaferFeature||cref-oaIntAppDef_oaWaferFeature,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntAppDef_oaWaferFeature_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntAppDef_oaWaferFeature",
sizeof(PyoaIntAppDef_oaWaferFeatureObject),
0,
(destructor)oaIntAppDef_oaWaferFeature_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntAppDef_oaWaferFeature_tp_compare, /* tp_compare */
(reprfunc)oaIntAppDef_oaWaferFeature_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntAppDef_oaWaferFeature_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntAppDef_oaWaferFeature_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntAppDef_oaWaferFeature_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntAppDef_oaWaferFeature_static_find_doc[] =
"Class: oaIntAppDef_oaWaferFeature, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaWaferFeature* find(const oaString& name)\n"
" Signature: find|ptr-oaIntAppDef_oaWaferFeature|cref-oaString,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaWaferFeature* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaIntAppDef_oaWaferFeature|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaIntAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaIntAppDef_oaWaferFeature_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaWaferFeaturep result= (oaIntAppDef_oaWaferFeature::find(p1.Data()));
return PyoaIntAppDef_oaWaferFeature_FromoaIntAppDef_oaWaferFeature(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaWaferFeaturep result= (oaIntAppDef_oaWaferFeature::find(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaWaferFeature_FromoaIntAppDef_oaWaferFeature(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaWaferFeature, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntAppDef_oaWaferFeature_static_get_doc[] =
"Class: oaIntAppDef_oaWaferFeature, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaIntAppDef_oaWaferFeature* get(const oaString& name)\n"
" Signature: get|ptr-oaIntAppDef_oaWaferFeature|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4)\n"
" Calls: oaIntAppDef_oaWaferFeature* get(const oaString& name,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaWaferFeature|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaWaferFeature* get(const oaString& name,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaWaferFeature|cref-oaString,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name . You can create an integer extension on any object except another extension.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" defValue\n"
" An optional default value\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaIntAppDef_oaWaferFeature* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaIntAppDef_oaWaferFeature|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4)\n"
" Calls: oaIntAppDef_oaWaferFeature* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue)\n"
" Signature: get|ptr-oaIntAppDef_oaWaferFeature|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
" Calls: oaIntAppDef_oaWaferFeature* get(const oaString& name,const oaAppObjectDef* objDef,oaInt4 defValue,oaBoolean persist)\n"
" Signature: get|ptr-oaIntAppDef_oaWaferFeature|cref-oaString,cptr-oaAppObjectDef,simple-oaInt4,simple-oaBoolean,\n"
" This function constructs an oaIntAppDef object, creating an integer extension with the specified name for the specified object type.\n"
" name\n"
" The name given to the oaIntAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" defValue\n"
" persist\n"
" Saves the oaIntAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaIntAppDef_oaWaferFeature_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaIntAppDef_oaWaferFeaturep result= (oaIntAppDef_oaWaferFeature::get(p1.Data()));
return PyoaIntAppDef_oaWaferFeature_FromoaIntAppDef_oaWaferFeature(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4)
{
PyParamoaString p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
oaIntAppDef_oaWaferFeaturep result= (oaIntAppDef_oaWaferFeature::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaWaferFeature_FromoaIntAppDef_oaWaferFeature(result);
}
}
PyErr_Clear();
// Case: (oaString,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaInt4 p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaInt4_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
oaIntAppDef_oaWaferFeaturep result= (oaIntAppDef_oaWaferFeature::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaWaferFeature_FromoaIntAppDef_oaWaferFeature(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaWaferFeaturep result= (oaIntAppDef_oaWaferFeature::get(p1.Data(),p2.Data()));
return PyoaIntAppDef_oaWaferFeature_FromoaIntAppDef_oaWaferFeature(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaWaferFeaturep result= (oaIntAppDef_oaWaferFeature::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntAppDef_oaWaferFeature_FromoaIntAppDef_oaWaferFeature(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaInt4,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaInt4 p3;
PyParamoaBoolean p4;
if (PyArg_ParseTuple(args,"O&O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaInt4_Convert,&p3,
&PyoaBoolean_Convert,&p4)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaIntAppDef_oaWaferFeaturep result= (oaIntAppDef_oaWaferFeature::get(p1.Data(),p2.Data(),p3.Data(),p4.Data()));
return PyoaIntAppDef_oaWaferFeature_FromoaIntAppDef_oaWaferFeature(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaIntAppDef_oaWaferFeature, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaInt4)\n"
" (oaString,oaInt4,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaInt4)\n"
" (oaString,oaAppObjectDef,oaInt4,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntAppDef_oaWaferFeature_staticmethodlist[] = {
{"static_find",(PyCFunction)oaIntAppDef_oaWaferFeature_static_find,METH_VARARGS,oaIntAppDef_oaWaferFeature_static_find_doc},
{"static_get",(PyCFunction)oaIntAppDef_oaWaferFeature_static_get,METH_VARARGS,oaIntAppDef_oaWaferFeature_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntAppDef_oaWaferFeature_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntAppDef_oaWaferFeature_Type)<0) {
printf("** PyType_Ready failed for: oaIntAppDef_oaWaferFeature\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntAppDef_oaWaferFeature",
(PyObject*)(&PyoaIntAppDef_oaWaferFeature_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntAppDef_oaWaferFeature\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntAppDef_oaWaferFeature_Type.tp_dict;
for(method=oaIntAppDef_oaWaferFeature_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntDualIntArrayTblValue
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntDualIntArrayTblValue_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntDualIntArrayTblValue_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntDualIntArrayTblValueObject* self = (PyoaIntDualIntArrayTblValueObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntDualIntArrayTblValue)
{
PyParamoaIntDualIntArrayTblValue p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntDualIntArrayTblValue_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntDualIntArrayTblValue, Choices are:\n"
" (oaIntDualIntArrayTblValue)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntDualIntArrayTblValue_tp_dealloc(PyoaIntDualIntArrayTblValueObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntDualIntArrayTblValue_tp_repr(PyObject *ob)
{
PyParamoaIntDualIntArrayTblValue value;
int convert_status=PyoaIntDualIntArrayTblValue_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[47];
sprintf(buffer,"<oaIntDualIntArrayTblValue::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntDualIntArrayTblValue_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntDualIntArrayTblValue v1;
PyParamoaIntDualIntArrayTblValue v2;
int convert_status1=PyoaIntDualIntArrayTblValue_Convert(ob1,&v1);
int convert_status2=PyoaIntDualIntArrayTblValue_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntDualIntArrayTblValue_Convert(PyObject* ob,PyParamoaIntDualIntArrayTblValue* result)
{
if (ob == NULL) return 1;
if (PyoaIntDualIntArrayTblValue_Check(ob)) {
result->SetData( (oaIntDualIntArrayTblValue**) ((PyoaIntDualIntArrayTblValueObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntDualIntArrayTblValue Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntDualIntArrayTblValue_FromoaIntDualIntArrayTblValue(oaIntDualIntArrayTblValue** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntDualIntArrayTblValue* data=*value;
PyObject* bself = PyoaIntDualIntArrayTblValue_Type.tp_alloc(&PyoaIntDualIntArrayTblValue_Type,0);
if (bself == NULL) return bself;
PyoaIntDualIntArrayTblValueObject* self = (PyoaIntDualIntArrayTblValueObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntDualIntArrayTblValue_FromoaIntDualIntArrayTblValue(oaIntDualIntArrayTblValue* data)
{
if (data) {
PyObject* bself = PyoaIntDualIntArrayTblValue_Type.tp_alloc(&PyoaIntDualIntArrayTblValue_Type,0);
if (bself == NULL) return bself;
PyoaIntDualIntArrayTblValueObject* self = (PyoaIntDualIntArrayTblValueObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntDualIntArrayTblValue_get_doc[] =
"Class: oaIntDualIntArrayTblValue, Function: get\n"
" Paramegers: (oa1DLookupTbl_oaInt4_oaDualIntArray)\n"
" Calls: void get(oa1DLookupTbl_oaInt4_oaDualIntArray& tbl) const\n"
" Signature: get|void-void|ref-oa1DLookupTbl_oaInt4_oaDualIntArray,\n"
" BrowseData: 0,oa1DLookupTbl_oaInt4_oaDualIntArray\n"
" This function returns the table of values of this object.\n"
" tbl\n"
" This object's look up table of integer and dual integer array values.\n"
" Todo\n"
" Add description of member function. Add description of each parameter.\n"
;
static PyObject*
oaIntDualIntArrayTblValue_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntDualIntArrayTblValue data;
int convert_status=PyoaIntDualIntArrayTblValue_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntDualIntArrayTblValueObject* self=(PyoaIntDualIntArrayTblValueObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoa1DLookupTbl_oaInt4_oaDualIntArray p1;
if (PyArg_ParseTuple(args,"O&",
&Pyoa1DLookupTbl_oaInt4_oaDualIntArray_Convert,&p1)) {
data.DataCall()->get(p1.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntDualIntArrayTblValue_set_doc[] =
"Class: oaIntDualIntArrayTblValue, Function: set\n"
" Paramegers: (oa1DLookupTbl_oaInt4_oaDualIntArray)\n"
" Calls: void set(const oa1DLookupTbl_oaInt4_oaDualIntArray& tbl)\n"
" Signature: set|void-void|cref-oa1DLookupTbl_oaInt4_oaDualIntArray,\n"
" This function sets the table of values on this object.\n"
" tbl\n"
" The look up table of integer and dual integer array values to set on this object.\n"
" Todo\n"
" Add description of member function. Add description of each parameter.\n"
;
static PyObject*
oaIntDualIntArrayTblValue_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntDualIntArrayTblValue data;
int convert_status=PyoaIntDualIntArrayTblValue_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntDualIntArrayTblValueObject* self=(PyoaIntDualIntArrayTblValueObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoa1DLookupTbl_oaInt4_oaDualIntArray p1;
if (PyArg_ParseTuple(args,"O&",
&Pyoa1DLookupTbl_oaInt4_oaDualIntArray_Convert,&p1)) {
data.DataCall()->set(p1.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntDualIntArrayTblValue_isNull_doc[] =
"Class: oaIntDualIntArrayTblValue, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntDualIntArrayTblValue_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntDualIntArrayTblValue data;
int convert_status=PyoaIntDualIntArrayTblValue_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntDualIntArrayTblValue_assign_doc[] =
"Class: oaIntDualIntArrayTblValue, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntDualIntArrayTblValue_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntDualIntArrayTblValue data;
int convert_status=PyoaIntDualIntArrayTblValue_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntDualIntArrayTblValue p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntDualIntArrayTblValue_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntDualIntArrayTblValue_methodlist[] = {
{"get",(PyCFunction)oaIntDualIntArrayTblValue_get,METH_VARARGS,oaIntDualIntArrayTblValue_get_doc},
{"set",(PyCFunction)oaIntDualIntArrayTblValue_set,METH_VARARGS,oaIntDualIntArrayTblValue_set_doc},
{"isNull",(PyCFunction)oaIntDualIntArrayTblValue_tp_isNull,METH_VARARGS,oaIntDualIntArrayTblValue_isNull_doc},
{"assign",(PyCFunction)oaIntDualIntArrayTblValue_tp_assign,METH_VARARGS,oaIntDualIntArrayTblValue_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntDualIntArrayTblValue_doc[] =
"Class: oaIntDualIntArrayTblValue\n"
" This class implements oaValue functionality for a 1D lookup table, in which oaInt4 integers represent keys, and arrays of oaInt4 integer pairs represent values. It is declared in the oaBase module.\n"
" Todo\n"
" Add description of class.\n"
"Constructors:\n"
" Paramegers: (oaIntDualIntArrayTblValue)\n"
" Calls: (const oaIntDualIntArrayTblValue&)\n"
" Signature: oaIntDualIntArrayTblValue||cref-oaIntDualIntArrayTblValue,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntDualIntArrayTblValue_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntDualIntArrayTblValue",
sizeof(PyoaIntDualIntArrayTblValueObject),
0,
(destructor)oaIntDualIntArrayTblValue_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntDualIntArrayTblValue_tp_compare, /* tp_compare */
(reprfunc)oaIntDualIntArrayTblValue_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntDualIntArrayTblValue_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntDualIntArrayTblValue_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaValue_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntDualIntArrayTblValue_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntDualIntArrayTblValue_static_create_doc[] =
"Class: oaIntDualIntArrayTblValue, Function: create\n"
" Paramegers: (oaObject,oa1DLookupTbl_oaInt4_oaDualIntArray)\n"
" Calls: oaIntDualIntArrayTblValue* create(oaObject* database,const oa1DLookupTbl_oaInt4_oaDualIntArray& value)\n"
" Signature: create|ptr-oaIntDualIntArrayTblValue|ptr-oaObject,cref-oa1DLookupTbl_oaInt4_oaDualIntArray,\n"
" This function creates an integer oaIntDualIntArrayTbl value in the specified database.\n"
" database\n"
" The database in which the intDualIntArrayTblValue is created.\n"
" value\n"
" The look up table of integer and dual integer array values to create the object.\n"
" Todo\n"
" Add description of member function. Add description of each parameter.\n"
;
static PyObject*
oaIntDualIntArrayTblValue_static_create(PyObject* ob, PyObject *args)
{
try {
PyParamoaObject p1;
PyParamoa1DLookupTbl_oaInt4_oaDualIntArray p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaObject_Convert,&p1,
&Pyoa1DLookupTbl_oaInt4_oaDualIntArray_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaIntDualIntArrayTblValuep result= (oaIntDualIntArrayTblValue::create(p1.Data(),p2.Data()));
return PyoaIntDualIntArrayTblValue_FromoaIntDualIntArrayTblValue(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntDualIntArrayTblValue_staticmethodlist[] = {
{"static_create",(PyCFunction)oaIntDualIntArrayTblValue_static_create,METH_VARARGS,oaIntDualIntArrayTblValue_static_create_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntDualIntArrayTblValue_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntDualIntArrayTblValue_Type)<0) {
printf("** PyType_Ready failed for: oaIntDualIntArrayTblValue\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntDualIntArrayTblValue",
(PyObject*)(&PyoaIntDualIntArrayTblValue_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntDualIntArrayTblValue\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntDualIntArrayTblValue_Type.tp_dict;
for(method=oaIntDualIntArrayTblValue_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntFltTblValue
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntFltTblValue_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntFltTblValue_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntFltTblValueObject* self = (PyoaIntFltTblValueObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntFltTblValue)
{
PyParamoaIntFltTblValue p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntFltTblValue_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntFltTblValue, Choices are:\n"
" (oaIntFltTblValue)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntFltTblValue_tp_dealloc(PyoaIntFltTblValueObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntFltTblValue_tp_repr(PyObject *ob)
{
PyParamoaIntFltTblValue value;
int convert_status=PyoaIntFltTblValue_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[38];
sprintf(buffer,"<oaIntFltTblValue::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntFltTblValue_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntFltTblValue v1;
PyParamoaIntFltTblValue v2;
int convert_status1=PyoaIntFltTblValue_Convert(ob1,&v1);
int convert_status2=PyoaIntFltTblValue_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntFltTblValue_Convert(PyObject* ob,PyParamoaIntFltTblValue* result)
{
if (ob == NULL) return 1;
if (PyoaIntFltTblValue_Check(ob)) {
result->SetData( (oaIntFltTblValue**) ((PyoaIntFltTblValueObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntFltTblValue Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntFltTblValue_FromoaIntFltTblValue(oaIntFltTblValue** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntFltTblValue* data=*value;
PyObject* bself = PyoaIntFltTblValue_Type.tp_alloc(&PyoaIntFltTblValue_Type,0);
if (bself == NULL) return bself;
PyoaIntFltTblValueObject* self = (PyoaIntFltTblValueObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntFltTblValue_FromoaIntFltTblValue(oaIntFltTblValue* data)
{
if (data) {
PyObject* bself = PyoaIntFltTblValue_Type.tp_alloc(&PyoaIntFltTblValue_Type,0);
if (bself == NULL) return bself;
PyoaIntFltTblValueObject* self = (PyoaIntFltTblValueObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntFltTblValue_get_doc[] =
"Class: oaIntFltTblValue, Function: get\n"
" Paramegers: (oa1DLookupTbl_oaInt4_oaFloat)\n"
" Calls: void get(oa1DLookupTbl_oaInt4_oaFloat& tbl) const\n"
" Signature: get|void-void|ref-oa1DLookupTbl_oaInt4_oaFloat,\n"
" BrowseData: 0,oa1DLookupTbl_oaInt4_oaFloat\n"
" This function returns the intFltTbl for this value.\n"
" tbl\n"
" The return value\n"
;
static PyObject*
oaIntFltTblValue_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntFltTblValue data;
int convert_status=PyoaIntFltTblValue_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntFltTblValueObject* self=(PyoaIntFltTblValueObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoa1DLookupTbl_oaInt4_oaFloat p1;
if (PyArg_ParseTuple(args,"O&",
&Pyoa1DLookupTbl_oaInt4_oaFloat_Convert,&p1)) {
data.DataCall()->get(p1.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntFltTblValue_set_doc[] =
"Class: oaIntFltTblValue, Function: set\n"
" Paramegers: (oa1DLookupTbl_oaInt4_oaFloat)\n"
" Calls: void set(const oa1DLookupTbl_oaInt4_oaFloat& tbl)\n"
" Signature: set|void-void|cref-oa1DLookupTbl_oaInt4_oaFloat,\n"
" This function sets this value to the specified intFltTbl value.\n"
" tbl\n"
" The intFltTbl value to set\n"
;
static PyObject*
oaIntFltTblValue_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntFltTblValue data;
int convert_status=PyoaIntFltTblValue_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntFltTblValueObject* self=(PyoaIntFltTblValueObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoa1DLookupTbl_oaInt4_oaFloat p1;
if (PyArg_ParseTuple(args,"O&",
&Pyoa1DLookupTbl_oaInt4_oaFloat_Convert,&p1)) {
data.DataCall()->set(p1.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntFltTblValue_isNull_doc[] =
"Class: oaIntFltTblValue, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntFltTblValue_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntFltTblValue data;
int convert_status=PyoaIntFltTblValue_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntFltTblValue_assign_doc[] =
"Class: oaIntFltTblValue, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntFltTblValue_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntFltTblValue data;
int convert_status=PyoaIntFltTblValue_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntFltTblValue p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntFltTblValue_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntFltTblValue_methodlist[] = {
{"get",(PyCFunction)oaIntFltTblValue_get,METH_VARARGS,oaIntFltTblValue_get_doc},
{"set",(PyCFunction)oaIntFltTblValue_set,METH_VARARGS,oaIntFltTblValue_set_doc},
{"isNull",(PyCFunction)oaIntFltTblValue_tp_isNull,METH_VARARGS,oaIntFltTblValue_isNull_doc},
{"assign",(PyCFunction)oaIntFltTblValue_tp_assign,METH_VARARGS,oaIntFltTblValue_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntFltTblValue_doc[] =
"Class: oaIntFltTblValue\n"
" The oaIntFltTblValue class represents a 1D lookup table value whose key is an integer and value is a float.\n"
" See oaValue for a discussion of the usage of all of the oaValue subclasses.\n"
"Constructors:\n"
" Paramegers: (oaIntFltTblValue)\n"
" Calls: (const oaIntFltTblValue&)\n"
" Signature: oaIntFltTblValue||cref-oaIntFltTblValue,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntFltTblValue_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntFltTblValue",
sizeof(PyoaIntFltTblValueObject),
0,
(destructor)oaIntFltTblValue_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntFltTblValue_tp_compare, /* tp_compare */
(reprfunc)oaIntFltTblValue_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntFltTblValue_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntFltTblValue_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaValue_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntFltTblValue_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntFltTblValue_static_create_doc[] =
"Class: oaIntFltTblValue, Function: create\n"
" Paramegers: (oaObject,oa1DLookupTbl_oaInt4_oaFloat)\n"
" Calls: oaIntFltTblValue* create(oaObject* database,const oa1DLookupTbl_oaInt4_oaFloat& value)\n"
" Signature: create|ptr-oaIntFltTblValue|ptr-oaObject,cref-oa1DLookupTbl_oaInt4_oaFloat,\n"
" This function creates intFltTbl value in the database specified.\n"
" database\n"
" The database in which to create the value.\n"
" value\n"
" The intFltTbl value\n"
" oacInvalidDatabase\n"
;
static PyObject*
oaIntFltTblValue_static_create(PyObject* ob, PyObject *args)
{
try {
PyParamoaObject p1;
PyParamoa1DLookupTbl_oaInt4_oaFloat p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaObject_Convert,&p1,
&Pyoa1DLookupTbl_oaInt4_oaFloat_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaIntFltTblValuep result= (oaIntFltTblValue::create(p1.Data(),p2.Data()));
return PyoaIntFltTblValue_FromoaIntFltTblValue(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntFltTblValue_staticmethodlist[] = {
{"static_create",(PyCFunction)oaIntFltTblValue_static_create,METH_VARARGS,oaIntFltTblValue_static_create_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntFltTblValue_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntFltTblValue_Type)<0) {
printf("** PyType_Ready failed for: oaIntFltTblValue\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntFltTblValue",
(PyObject*)(&PyoaIntFltTblValue_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntFltTblValue\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntFltTblValue_Type.tp_dict;
for(method=oaIntFltTblValue_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntProp
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntProp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntProp_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntPropObject* self = (PyoaIntPropObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntProp)
{
PyParamoaIntProp p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntProp_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntProp, Choices are:\n"
" (oaIntProp)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntProp_tp_dealloc(PyoaIntPropObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntProp_tp_repr(PyObject *ob)
{
PyParamoaIntProp value;
int convert_status=PyoaIntProp_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
if (!value.Data()) {
oaString buffer("<oaIntProp::NULL>");
result=PyString_FromString((char*)(const char*)buffer);
}
else {
oaString sresult;
value.DataCall()->getName(sresult);
char addr[31];
sprintf(addr,DISPLAY_FORMAT,POINTER_AS_DISPLAY(value.DataCall()));
oaString buffer;
buffer+=oaString("<oaIntProp::");
buffer+=oaString(addr);
buffer+=oaString("::");
buffer+=oaString(sresult);
buffer+=oaString(">");
result=PyString_FromString((char*)(const char*)buffer);
}
return result;
}
// ------------------------------------------------------------------
static int
oaIntProp_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntProp v1;
PyParamoaIntProp v2;
int convert_status1=PyoaIntProp_Convert(ob1,&v1);
int convert_status2=PyoaIntProp_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntProp_Convert(PyObject* ob,PyParamoaIntProp* result)
{
if (ob == NULL) return 1;
if (PyoaIntProp_Check(ob)) {
result->SetData( (oaIntProp**) ((PyoaIntPropObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntProp Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntProp_FromoaIntProp(oaIntProp** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntProp* data=*value;
PyObject* bself = PyoaIntProp_Type.tp_alloc(&PyoaIntProp_Type,0);
if (bself == NULL) return bself;
PyoaIntPropObject* self = (PyoaIntPropObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntProp_FromoaIntProp(oaIntProp* data)
{
if (data) {
PyObject* bself = PyoaIntProp_Type.tp_alloc(&PyoaIntProp_Type,0);
if (bself == NULL) return bself;
PyoaIntPropObject* self = (PyoaIntPropObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntProp_getValue_doc[] =
"Class: oaIntProp, Function: getValue\n"
" Paramegers: ()\n"
" Calls: oaInt4 getValue() const\n"
" Signature: getValue|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the value of this property.\n"
;
static PyObject*
oaIntProp_getValue(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntProp data;
int convert_status=PyoaIntProp_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntPropObject* self=(PyoaIntPropObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->getValue());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntProp_setValue_doc[] =
"Class: oaIntProp, Function: setValue\n"
" Paramegers: (oaInt4)\n"
" Calls: void setValue(oaInt4 value)\n"
" Signature: setValue|void-void|simple-oaInt4,\n"
" This function sets this property to the specified value.\n"
;
static PyObject*
oaIntProp_setValue(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntProp data;
int convert_status=PyoaIntProp_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntPropObject* self=(PyoaIntPropObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaInt4 p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaInt4_Convert,&p1)) {
data.DataCall()->setValue(p1.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntProp_isNull_doc[] =
"Class: oaIntProp, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntProp_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntProp data;
int convert_status=PyoaIntProp_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntProp_assign_doc[] =
"Class: oaIntProp, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntProp_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntProp data;
int convert_status=PyoaIntProp_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntProp p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntProp_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntProp_methodlist[] = {
{"getValue",(PyCFunction)oaIntProp_getValue,METH_VARARGS,oaIntProp_getValue_doc},
{"setValue",(PyCFunction)oaIntProp_setValue,METH_VARARGS,oaIntProp_setValue_doc},
{"isNull",(PyCFunction)oaIntProp_tp_isNull,METH_VARARGS,oaIntProp_isNull_doc},
{"assign",(PyCFunction)oaIntProp_tp_assign,METH_VARARGS,oaIntProp_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntProp_doc[] =
"Class: oaIntProp\n"
" The oaIntProp is a property that has an integer value.\n"
" Properties are application-defined values that can be added to any managed object in oaDesign , oaTech , and oaWafer databases except for the following paged objects: oaDevice , oaNode , oaParasiticNetwork , and oaSubNetwork .\n"
" To create properties on DM Objects, create the corresponding oaDMData object (using oaLibDMData::open , oaCellDMData::open , oaViewDMData::open , or oaCellViewDMData::open ), then create properties on that oaDMData object.\n"
" See oaProp for a general discussion of properties.\n"
"Constructors:\n"
" Paramegers: (oaIntProp)\n"
" Calls: (const oaIntProp&)\n"
" Signature: oaIntProp||cref-oaIntProp,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntProp_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntProp",
sizeof(PyoaIntPropObject),
0,
(destructor)oaIntProp_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntProp_tp_compare, /* tp_compare */
(reprfunc)oaIntProp_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntProp_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntProp_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaProp_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntProp_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntProp_static_create_doc[] =
"Class: oaIntProp, Function: create\n"
" Paramegers: (oaObject,oaString,oaInt4)\n"
" Calls: oaIntProp* create(oaObject* object,const oaString& name,oaInt4 value)\n"
" Signature: create|ptr-oaIntProp|ptr-oaObject,cref-oaString,simple-oaInt4,\n"
" This function creates an integer property with the specified attributes. The specified name is checked to verify it is unique for properties on the specified object .\n"
" object\n"
" The object to which to attach the property\n"
" name\n"
" The property name\n"
" value\n"
" The property value\n"
" A pointer to the oaIntProp\n"
" oacInvalidObjForProp\n"
" oacPropNameUsed\n"
;
static PyObject*
oaIntProp_static_create(PyObject* ob, PyObject *args)
{
try {
PyParamoaObject p1;
PyParamoaString p2;
PyParamoaInt4 p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaObject_Convert,&p1,
&PyoaString_Convert,&p2,
&PyoaInt4_Convert,&p3)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaIntPropp result= (oaIntProp::create(p1.Data(),p2.Data(),p3.Data()));
return PyoaIntProp_FromoaIntProp(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntProp_staticmethodlist[] = {
{"static_create",(PyCFunction)oaIntProp_static_create,METH_VARARGS,oaIntProp_static_create_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntProp_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntProp_Type)<0) {
printf("** PyType_Ready failed for: oaIntProp\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntProp",
(PyObject*)(&PyoaIntProp_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntProp\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntProp_Type.tp_dict;
for(method=oaIntProp_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntRange
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntRange_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntRange_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntRangeObject* self = (PyoaIntRangeObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: ()
{
if (PyArg_ParseTuple(args,"")) {
self->value = (oaRangeBase*) new oaIntRange();
return bself;
}
}
PyErr_Clear();
// Case: (oaRangeType,oaInt4)
{
PyParamoaRangeType p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaRangeType_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
self->value = (oaRangeBase*) new oaIntRange(p1.Data(),p2.Data());
return bself;
}
}
PyErr_Clear();
// Case: (oaRangeType,oaInt4,oaInt4)
{
PyParamoaRangeType p1;
PyParamoaInt4 p2;
PyParamoaInt4 p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaRangeType_Convert,&p1,
&PyoaInt4_Convert,&p2,
&PyoaInt4_Convert,&p3)) {
self->value = (oaRangeBase*) new oaIntRange(p1.Data(),p2.Data(),p3.Data());
return bself;
}
}
PyErr_Clear();
// Case: (oaIntRange)
{
PyParamoaIntRange p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntRange_Convert,&p1)) {
self->value=(oaRangeBase*) new oaIntRange(p1.Data());
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntRange, Choices are:\n"
" ()\n"
" (oaRangeType,oaInt4)\n"
" (oaRangeType,oaInt4,oaInt4)\n"
" (oaIntRange)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntRange_tp_dealloc(PyoaIntRangeObject* self)
{
if (!self->borrow) {
delete (oaIntRange*)(self->value);
}
Py_XDECREF(self->locks);
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntRange_tp_repr(PyObject *ob)
{
PyParamoaIntRange value;
int convert_status=PyoaIntRange_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[32];
sprintf(buffer,"<oaIntRange::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntRange_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntRange v1;
PyParamoaIntRange v2;
int convert_status1=PyoaIntRange_Convert(ob1,&v1);
int convert_status2=PyoaIntRange_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntRange_Convert(PyObject* ob,PyParamoaIntRange* result)
{
if (ob == NULL) return 1;
if (PyoaIntRange_Check(ob)) {
result->SetData( (oaIntRange*) ((PyoaIntRangeObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntRange Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntRange_FromoaIntRange(oaIntRange* data,int borrow,PyObject* lock)
{
if (data) {
PyObject* bself = PyoaIntRange_Type.tp_alloc(&PyoaIntRange_Type,0);
if (bself == NULL) return bself;
PyoaIntRangeObject* self = (PyoaIntRangeObject*)bself;
self->value = (oaRangeBase*) data;
self->locks = NULL;
self->borrow = borrow;
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntRange_doc[] =
"Class: oaIntRange\n"
" This class is used to specify various kinds of ranges such as greater than a lower bound, less than an upper bound, and between an upper and lower bound.\n"
" Todo\n"
" Developer check class description.\n"
"Constructors:\n"
" Paramegers: ()\n"
" Calls: oaIntRange()\n"
" Signature: oaIntRange||\n"
" This is the default constructor for oaIntRange. This constructor does not initialize any member variables.\n"
" Todo\n"
" Specify valid T input types to templated constructor.\n"
" Paramegers: (oaRangeType,oaInt4)\n"
" Calls: oaIntRange(oaRangeType type,oaInt4 value)\n"
" Signature: oaIntRange||simple-oaRangeType,simple-oaInt4,\n"
" This constructor creates oaInt4 range objects that have either a lower bound or upper bound. This constructor is used to specify range objects for the range types oacLessThanRangeType, oacLessThanEqualRangeType, oacGreaterThanRangeType, and oacGreaterThanEqualRangeType.\n"
" type\n"
" The type of the range object.\n"
" value\n"
" The upper bound or lower bound based on the type.\n"
" Paramegers: (oaRangeType,oaInt4,oaInt4)\n"
" Calls: oaIntRange(oaRangeType type,oaInt4 lowerBoundIn,oaInt4 upperBoundIn)\n"
" Signature: oaIntRange||simple-oaRangeType,simple-oaInt4,simple-oaInt4,\n"
" This constructor creates oaInt4 range objects that have both lower and upper bounds.\n"
" type\n"
" The type of the range object.\n"
" lowerBoundIn\n"
" The lower bound of the range object.\n"
" upperBoundIn\n"
" The upper bound of the range object.\n"
" oacInvalidTypeForRange\n"
" oacInvalidBoundsForRange\n"
" Paramegers: (oaIntRange)\n"
" Calls: (const oaIntRange&)\n"
" Signature: oaIntRange||cref-oaIntRange,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntRange_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntRange",
sizeof(PyoaIntRangeObject),
0,
(destructor)oaIntRange_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntRange_tp_compare, /* tp_compare */
(reprfunc)oaIntRange_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntRange_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaRange_oaInt4_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntRange_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntRange_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntRange_Type)<0) {
printf("** PyType_Ready failed for: oaIntRange\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntRange",
(PyObject*)(&PyoaIntRange_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntRange\n");
return -1;
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntRangeProp
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntRangeProp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntRangeProp_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntRangePropObject* self = (PyoaIntRangePropObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntRangeProp)
{
PyParamoaIntRangeProp p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntRangeProp_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntRangeProp, Choices are:\n"
" (oaIntRangeProp)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntRangeProp_tp_dealloc(PyoaIntRangePropObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntRangeProp_tp_repr(PyObject *ob)
{
PyParamoaIntRangeProp value;
int convert_status=PyoaIntRangeProp_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
if (!value.Data()) {
oaString buffer("<oaIntRangeProp::NULL>");
result=PyString_FromString((char*)(const char*)buffer);
}
else {
oaString sresult;
value.DataCall()->getName(sresult);
char addr[36];
sprintf(addr,DISPLAY_FORMAT,POINTER_AS_DISPLAY(value.DataCall()));
oaString buffer;
buffer+=oaString("<oaIntRangeProp::");
buffer+=oaString(addr);
buffer+=oaString("::");
buffer+=oaString(sresult);
buffer+=oaString(">");
result=PyString_FromString((char*)(const char*)buffer);
}
return result;
}
// ------------------------------------------------------------------
static int
oaIntRangeProp_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntRangeProp v1;
PyParamoaIntRangeProp v2;
int convert_status1=PyoaIntRangeProp_Convert(ob1,&v1);
int convert_status2=PyoaIntRangeProp_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntRangeProp_Convert(PyObject* ob,PyParamoaIntRangeProp* result)
{
if (ob == NULL) return 1;
if (PyoaIntRangeProp_Check(ob)) {
result->SetData( (oaIntRangeProp**) ((PyoaIntRangePropObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntRangeProp Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntRangeProp_FromoaIntRangeProp(oaIntRangeProp** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntRangeProp* data=*value;
PyObject* bself = PyoaIntRangeProp_Type.tp_alloc(&PyoaIntRangeProp_Type,0);
if (bself == NULL) return bself;
PyoaIntRangePropObject* self = (PyoaIntRangePropObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntRangeProp_FromoaIntRangeProp(oaIntRangeProp* data)
{
if (data) {
PyObject* bself = PyoaIntRangeProp_Type.tp_alloc(&PyoaIntRangeProp_Type,0);
if (bself == NULL) return bself;
PyoaIntRangePropObject* self = (PyoaIntRangePropObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntRangeProp_getLowerBound_doc[] =
"Class: oaIntRangeProp, Function: getLowerBound\n"
" Paramegers: ()\n"
" Calls: oaInt4 getLowerBound() const\n"
" Signature: getLowerBound|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the lower bound of the integer range.\n"
;
static PyObject*
oaIntRangeProp_getLowerBound(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntRangeProp data;
int convert_status=PyoaIntRangeProp_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntRangePropObject* self=(PyoaIntRangePropObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->getLowerBound());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntRangeProp_getUpperBound_doc[] =
"Class: oaIntRangeProp, Function: getUpperBound\n"
" Paramegers: ()\n"
" Calls: oaInt4 getUpperBound() const\n"
" Signature: getUpperBound|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the upper bound of the integer range.\n"
;
static PyObject*
oaIntRangeProp_getUpperBound(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntRangeProp data;
int convert_status=PyoaIntRangeProp_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntRangePropObject* self=(PyoaIntRangePropObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->getUpperBound());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntRangeProp_getValue_doc[] =
"Class: oaIntRangeProp, Function: getValue\n"
" Paramegers: ()\n"
" Calls: oaInt4 getValue() const\n"
" Signature: getValue|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the value of this property.\n"
;
static PyObject*
oaIntRangeProp_getValue(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntRangeProp data;
int convert_status=PyoaIntRangeProp_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntRangePropObject* self=(PyoaIntRangePropObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->getValue());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntRangeProp_set_doc[] =
"Class: oaIntRangeProp, Function: set\n"
" Paramegers: (oaInt4,oaInt4,oaInt4)\n"
" Calls: void set(oaInt4 lowerBound,oaInt4 value,oaInt4 upperBound)\n"
" Signature: set|void-void|simple-oaInt4,simple-oaInt4,simple-oaInt4,\n"
" This function sets the attributes for this property.\n"
" lowerBound\n"
" The lower bound for the range\n"
" value\n"
" The property value\n"
" upperBound\n"
" The upper bound for the range\n"
" oacInvalidValueForIntRange\n"
;
static PyObject*
oaIntRangeProp_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntRangeProp data;
int convert_status=PyoaIntRangeProp_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntRangePropObject* self=(PyoaIntRangePropObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaInt4 p1;
PyParamoaInt4 p2;
PyParamoaInt4 p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaInt4_Convert,&p1,
&PyoaInt4_Convert,&p2,
&PyoaInt4_Convert,&p3)) {
data.DataCall()->set(p1.Data(),p2.Data(),p3.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntRangeProp_setValue_doc[] =
"Class: oaIntRangeProp, Function: setValue\n"
" Paramegers: (oaInt4)\n"
" Calls: void setValue(oaInt4 value)\n"
" Signature: setValue|void-void|simple-oaInt4,\n"
" This function sets this property to the specified value.\n"
" value\n"
" The property value\n"
" oacInvalidValueForIntRange\n"
;
static PyObject*
oaIntRangeProp_setValue(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntRangeProp data;
int convert_status=PyoaIntRangeProp_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntRangePropObject* self=(PyoaIntRangePropObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaInt4 p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaInt4_Convert,&p1)) {
data.DataCall()->setValue(p1.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntRangeProp_isNull_doc[] =
"Class: oaIntRangeProp, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntRangeProp_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntRangeProp data;
int convert_status=PyoaIntRangeProp_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntRangeProp_assign_doc[] =
"Class: oaIntRangeProp, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntRangeProp_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntRangeProp data;
int convert_status=PyoaIntRangeProp_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntRangeProp p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntRangeProp_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntRangeProp_methodlist[] = {
{"getLowerBound",(PyCFunction)oaIntRangeProp_getLowerBound,METH_VARARGS,oaIntRangeProp_getLowerBound_doc},
{"getUpperBound",(PyCFunction)oaIntRangeProp_getUpperBound,METH_VARARGS,oaIntRangeProp_getUpperBound_doc},
{"getValue",(PyCFunction)oaIntRangeProp_getValue,METH_VARARGS,oaIntRangeProp_getValue_doc},
{"set",(PyCFunction)oaIntRangeProp_set,METH_VARARGS,oaIntRangeProp_set_doc},
{"setValue",(PyCFunction)oaIntRangeProp_setValue,METH_VARARGS,oaIntRangeProp_setValue_doc},
{"isNull",(PyCFunction)oaIntRangeProp_tp_isNull,METH_VARARGS,oaIntRangeProp_isNull_doc},
{"assign",(PyCFunction)oaIntRangeProp_tp_assign,METH_VARARGS,oaIntRangeProp_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntRangeProp_doc[] =
"Class: oaIntRangeProp\n"
" The oaIntRangeProp is a property that has an integer-type value as well as a range of valid values that the integer is allowed to take on. The range can be used by a generic property editor to assist a user to enter a proper value.\n"
" Properties are application-defined values that can be added to any managed object in oaDesign , oaTech , and oaWafer databases except for the following paged objects: oaDevice , oaNode , oaParasiticNetwork , and oaSubNetwork .\n"
" To create properties on DM Objects, create the corresponding oaDMData object (using oaLibDMData::open , oaCellDMData::open , oaViewDMData::open , or oaCellViewDMData::open ), then create properties on that oaDMData object.\n"
" See oaProp for a general discussion of properties.\n"
"Constructors:\n"
" Paramegers: (oaIntRangeProp)\n"
" Calls: (const oaIntRangeProp&)\n"
" Signature: oaIntRangeProp||cref-oaIntRangeProp,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntRangeProp_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntRangeProp",
sizeof(PyoaIntRangePropObject),
0,
(destructor)oaIntRangeProp_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntRangeProp_tp_compare, /* tp_compare */
(reprfunc)oaIntRangeProp_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntRangeProp_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntRangeProp_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaProp_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntRangeProp_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntRangeProp_static_create_doc[] =
"Class: oaIntRangeProp, Function: create\n"
" Paramegers: (oaObject,oaString,oaInt4,oaInt4,oaInt4)\n"
" Calls: oaIntRangeProp* create(oaObject* object,const oaString& name,oaInt4 lowerBound,oaInt4 value,oaInt4 upperBound)\n"
" Signature: create|ptr-oaIntRangeProp|ptr-oaObject,cref-oaString,simple-oaInt4,simple-oaInt4,simple-oaInt4,\n"
" This function creates an integer-range property with the specified attributes. The specified name is checked to verify it is unique for properties on the specified object.\n"
" object\n"
" The object on which to attach the property.\n"
" name\n"
" The property name.\n"
" lowerBound\n"
" The lower bound for the range.\n"
" value\n"
" The property value.\n"
" upperBound\n"
" The upper bound for the range.\n"
" A pointer to the oaIntRangeProp\n"
" oacInvalidObjForProp\n"
" oacInvalidValueForIntRange\n"
" oacPropNameUsed\n"
;
static PyObject*
oaIntRangeProp_static_create(PyObject* ob, PyObject *args)
{
try {
PyParamoaObject p1;
PyParamoaString p2;
PyParamoaInt4 p3;
PyParamoaInt4 p4;
PyParamoaInt4 p5;
if (PyArg_ParseTuple(args,"O&O&O&O&O&",
&PyoaObject_Convert,&p1,
&PyoaString_Convert,&p2,
&PyoaInt4_Convert,&p3,
&PyoaInt4_Convert,&p4,
&PyoaInt4_Convert,&p5)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaIntRangePropp result= (oaIntRangeProp::create(p1.Data(),p2.Data(),p3.Data(),p4.Data(),p5.Data()));
return PyoaIntRangeProp_FromoaIntRangeProp(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntRangeProp_staticmethodlist[] = {
{"static_create",(PyCFunction)oaIntRangeProp_static_create,METH_VARARGS,oaIntRangeProp_static_create_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntRangeProp_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntRangeProp_Type)<0) {
printf("** PyType_Ready failed for: oaIntRangeProp\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntRangeProp",
(PyObject*)(&PyoaIntRangeProp_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntRangeProp\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntRangeProp_Type.tp_dict;
for(method=oaIntRangeProp_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntRangeValue
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntRangeValue_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntRangeValue_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntRangeValueObject* self = (PyoaIntRangeValueObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntRangeValue)
{
PyParamoaIntRangeValue p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntRangeValue_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntRangeValue, Choices are:\n"
" (oaIntRangeValue)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntRangeValue_tp_dealloc(PyoaIntRangeValueObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntRangeValue_tp_repr(PyObject *ob)
{
PyParamoaIntRangeValue value;
int convert_status=PyoaIntRangeValue_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[37];
sprintf(buffer,"<oaIntRangeValue::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntRangeValue_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntRangeValue v1;
PyParamoaIntRangeValue v2;
int convert_status1=PyoaIntRangeValue_Convert(ob1,&v1);
int convert_status2=PyoaIntRangeValue_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntRangeValue_Convert(PyObject* ob,PyParamoaIntRangeValue* result)
{
if (ob == NULL) return 1;
if (PyoaIntRangeValue_Check(ob)) {
result->SetData( (oaIntRangeValue**) ((PyoaIntRangeValueObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntRangeValue Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntRangeValue_FromoaIntRangeValue(oaIntRangeValue** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntRangeValue* data=*value;
PyObject* bself = PyoaIntRangeValue_Type.tp_alloc(&PyoaIntRangeValue_Type,0);
if (bself == NULL) return bself;
PyoaIntRangeValueObject* self = (PyoaIntRangeValueObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntRangeValue_FromoaIntRangeValue(oaIntRangeValue* data)
{
if (data) {
PyObject* bself = PyoaIntRangeValue_Type.tp_alloc(&PyoaIntRangeValue_Type,0);
if (bself == NULL) return bself;
PyoaIntRangeValueObject* self = (PyoaIntRangeValueObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntRangeValue_get_doc[] =
"Class: oaIntRangeValue, Function: get\n"
" Paramegers: (oaIntRange)\n"
" Calls: void get(oaIntRange& value) const\n"
" Signature: get|void-void|ref-oaIntRange,\n"
" BrowseData: 0,oaIntRange\n"
" This function returns the range value of this object.\n"
" value\n"
" The range of this object.\n"
;
static PyObject*
oaIntRangeValue_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntRangeValue data;
int convert_status=PyoaIntRangeValue_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntRangeValueObject* self=(PyoaIntRangeValueObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaIntRange p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaIntRange_Convert,&p1)) {
data.DataCall()->get(p1.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntRangeValue_set_doc[] =
"Class: oaIntRangeValue, Function: set\n"
" Paramegers: (oaIntRange)\n"
" Calls: void set(const oaIntRange& value)\n"
" Signature: set|void-void|cref-oaIntRange,\n"
" This function sets the value of this object to the specified range.\n"
" value\n"
" The range that is set on this object.\n"
;
static PyObject*
oaIntRangeValue_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntRangeValue data;
int convert_status=PyoaIntRangeValue_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntRangeValueObject* self=(PyoaIntRangeValueObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaIntRange p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaIntRange_Convert,&p1)) {
data.DataCall()->set(p1.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntRangeValue_isNull_doc[] =
"Class: oaIntRangeValue, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntRangeValue_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntRangeValue data;
int convert_status=PyoaIntRangeValue_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntRangeValue_assign_doc[] =
"Class: oaIntRangeValue, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntRangeValue_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntRangeValue data;
int convert_status=PyoaIntRangeValue_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntRangeValue p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntRangeValue_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntRangeValue_methodlist[] = {
{"get",(PyCFunction)oaIntRangeValue_get,METH_VARARGS,oaIntRangeValue_get_doc},
{"set",(PyCFunction)oaIntRangeValue_set,METH_VARARGS,oaIntRangeValue_set_doc},
{"isNull",(PyCFunction)oaIntRangeValue_tp_isNull,METH_VARARGS,oaIntRangeValue_isNull_doc},
{"assign",(PyCFunction)oaIntRangeValue_tp_assign,METH_VARARGS,oaIntRangeValue_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntRangeValue_doc[] =
"Class: oaIntRangeValue\n"
" This class implements oaValue functionality for the instantiation of the oaRange template class with an oaInt4 type.\n"
" Todo\n"
" Check description of class.\n"
"Constructors:\n"
" Paramegers: (oaIntRangeValue)\n"
" Calls: (const oaIntRangeValue&)\n"
" Signature: oaIntRangeValue||cref-oaIntRangeValue,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntRangeValue_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntRangeValue",
sizeof(PyoaIntRangeValueObject),
0,
(destructor)oaIntRangeValue_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntRangeValue_tp_compare, /* tp_compare */
(reprfunc)oaIntRangeValue_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntRangeValue_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntRangeValue_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaValue_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntRangeValue_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntRangeValue_static_create_doc[] =
"Class: oaIntRangeValue, Function: create\n"
" Paramegers: (oaObject,oaIntRange)\n"
" Calls: oaIntRangeValue* create(oaObject* database,const oaIntRange& value)\n"
" Signature: create|ptr-oaIntRangeValue|ptr-oaObject,cref-oaIntRange,\n"
" This function creates an integer range value in the specified database.\n"
" database\n"
" The database in which the intValue is created.\n"
" value\n"
" The range to create the range value with.\n"
;
static PyObject*
oaIntRangeValue_static_create(PyObject* ob, PyObject *args)
{
try {
PyParamoaObject p1;
PyParamoaIntRange p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaObject_Convert,&p1,
&PyoaIntRange_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaIntRangeValuep result= (oaIntRangeValue::create(p1.Data(),p2.Data()));
return PyoaIntRangeValue_FromoaIntRangeValue(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntRangeValue_staticmethodlist[] = {
{"static_create",(PyCFunction)oaIntRangeValue_static_create,METH_VARARGS,oaIntRangeValue_static_create_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntRangeValue_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntRangeValue_Type)<0) {
printf("** PyType_Ready failed for: oaIntRangeValue\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntRangeValue",
(PyObject*)(&PyoaIntRangeValue_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntRangeValue\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntRangeValue_Type.tp_dict;
for(method=oaIntRangeValue_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaIntValue
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaIntValue_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaIntValue_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaIntValueObject* self = (PyoaIntValueObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaIntValue)
{
PyParamoaIntValue p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntValue_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaIntValue, Choices are:\n"
" (oaIntValue)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaIntValue_tp_dealloc(PyoaIntValueObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaIntValue_tp_repr(PyObject *ob)
{
PyParamoaIntValue value;
int convert_status=PyoaIntValue_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[32];
sprintf(buffer,"<oaIntValue::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaIntValue_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaIntValue v1;
PyParamoaIntValue v2;
int convert_status1=PyoaIntValue_Convert(ob1,&v1);
int convert_status2=PyoaIntValue_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaIntValue_Convert(PyObject* ob,PyParamoaIntValue* result)
{
if (ob == NULL) return 1;
if (PyoaIntValue_Check(ob)) {
result->SetData( (oaIntValue**) ((PyoaIntValueObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaIntValue Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaIntValue_FromoaIntValue(oaIntValue** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaIntValue* data=*value;
PyObject* bself = PyoaIntValue_Type.tp_alloc(&PyoaIntValue_Type,0);
if (bself == NULL) return bself;
PyoaIntValueObject* self = (PyoaIntValueObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaIntValue_FromoaIntValue(oaIntValue* data)
{
if (data) {
PyObject* bself = PyoaIntValue_Type.tp_alloc(&PyoaIntValue_Type,0);
if (bself == NULL) return bself;
PyoaIntValueObject* self = (PyoaIntValueObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntValue_get_doc[] =
"Class: oaIntValue, Function: get\n"
" Paramegers: ()\n"
" Calls: oaInt4 get() const\n"
" Signature: get|simple-oaInt4|\n"
" BrowseData: 1\n"
" This function returns the integer of this value.\n"
;
static PyObject*
oaIntValue_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntValue data;
int convert_status=PyoaIntValue_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntValueObject* self=(PyoaIntValueObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
if (PyArg_ParseTuple(args,"")) {
oaInt4 result= (data.DataCall()->get());
return PyoaInt4_FromoaInt4(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntValue_set_doc[] =
"Class: oaIntValue, Function: set\n"
" Paramegers: (oaInt4)\n"
" Calls: void set(oaInt4 value)\n"
" Signature: set|void-void|simple-oaInt4,\n"
" This function sets this value to the specified integer value.\n"
" value\n"
" The integer value to set\n"
;
static PyObject*
oaIntValue_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaIntValue data;
int convert_status=PyoaIntValue_Convert(ob,&data);
assert(convert_status!=0);
PyoaIntValueObject* self=(PyoaIntValueObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaInt4 p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaInt4_Convert,&p1)) {
data.DataCall()->set(p1.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaIntValue_isNull_doc[] =
"Class: oaIntValue, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaIntValue_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaIntValue data;
int convert_status=PyoaIntValue_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaIntValue_assign_doc[] =
"Class: oaIntValue, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaIntValue_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaIntValue data;
int convert_status=PyoaIntValue_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaIntValue p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaIntValue_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaIntValue_methodlist[] = {
{"get",(PyCFunction)oaIntValue_get,METH_VARARGS,oaIntValue_get_doc},
{"set",(PyCFunction)oaIntValue_set,METH_VARARGS,oaIntValue_set_doc},
{"isNull",(PyCFunction)oaIntValue_tp_isNull,METH_VARARGS,oaIntValue_isNull_doc},
{"assign",(PyCFunction)oaIntValue_tp_assign,METH_VARARGS,oaIntValue_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntValue_doc[] =
"Class: oaIntValue\n"
" The oaIntValue class represents an integer value.\n"
" See oaValue for a discussion of the usage of all of the oaValue subclasses.\n"
"Constructors:\n"
" Paramegers: (oaIntValue)\n"
" Calls: (const oaIntValue&)\n"
" Signature: oaIntValue||cref-oaIntValue,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaIntValue_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaIntValue",
sizeof(PyoaIntValueObject),
0,
(destructor)oaIntValue_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaIntValue_tp_compare, /* tp_compare */
(reprfunc)oaIntValue_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaIntValue_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaIntValue_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaValue_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaIntValue_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaIntValue_static_create_doc[] =
"Class: oaIntValue, Function: create\n"
" Paramegers: (oaObject,oaInt4)\n"
" Calls: oaIntValue* create(oaObject* database,oaInt4 value)\n"
" Signature: create|ptr-oaIntValue|ptr-oaObject,simple-oaInt4,\n"
" This function creates an integer value in the database specified.\n"
" database\n"
" The database in which the intValue is created.\n"
" value\n"
" The integer value.\n"
" oacInvalidDatabase\n"
;
static PyObject*
oaIntValue_static_create(PyObject* ob, PyObject *args)
{
try {
PyParamoaObject p1;
PyParamoaInt4 p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaObject_Convert,&p1,
&PyoaInt4_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaIntValuep result= (oaIntValue::create(p1.Data(),p2.Data()));
return PyoaIntValue_FromoaIntValue(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaIntValue_staticmethodlist[] = {
{"static_create",(PyCFunction)oaIntValue_static_create,METH_VARARGS,oaIntValue_static_create_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaIntValue_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaIntValue_Type)<0) {
printf("** PyType_Ready failed for: oaIntValue\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaIntValue",
(PyObject*)(&PyoaIntValue_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaIntValue\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaIntValue_Type.tp_dict;
for(method=oaIntValue_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaAnalysisOpPoint
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaAnalysisOpPoint_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaAnalysisOpPoint_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaAnalysisOpPointObject* self = (PyoaInterPointerAppDef_oaAnalysisOpPointObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaAnalysisOpPoint)
{
PyParamoaInterPointerAppDef_oaAnalysisOpPoint p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaAnalysisOpPoint_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaAnalysisOpPoint, Choices are:\n"
" (oaInterPointerAppDef_oaAnalysisOpPoint)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaAnalysisOpPoint_tp_dealloc(PyoaInterPointerAppDef_oaAnalysisOpPointObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaAnalysisOpPoint_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaAnalysisOpPoint value;
int convert_status=PyoaInterPointerAppDef_oaAnalysisOpPoint_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[60];
sprintf(buffer,"<oaInterPointerAppDef_oaAnalysisOpPoint::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaAnalysisOpPoint_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaAnalysisOpPoint v1;
PyParamoaInterPointerAppDef_oaAnalysisOpPoint v2;
int convert_status1=PyoaInterPointerAppDef_oaAnalysisOpPoint_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaAnalysisOpPoint_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaAnalysisOpPoint_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaAnalysisOpPoint* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaAnalysisOpPoint_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaAnalysisOpPoint**) ((PyoaInterPointerAppDef_oaAnalysisOpPointObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaAnalysisOpPoint Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaAnalysisOpPoint_FromoaInterPointerAppDef_oaAnalysisOpPoint(oaInterPointerAppDef_oaAnalysisOpPoint** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaAnalysisOpPoint* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaAnalysisOpPoint_Type.tp_alloc(&PyoaInterPointerAppDef_oaAnalysisOpPoint_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaAnalysisOpPointObject* self = (PyoaInterPointerAppDef_oaAnalysisOpPointObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaAnalysisOpPoint_FromoaInterPointerAppDef_oaAnalysisOpPoint(oaInterPointerAppDef_oaAnalysisOpPoint* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaAnalysisOpPoint_Type.tp_alloc(&PyoaInterPointerAppDef_oaAnalysisOpPoint_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaAnalysisOpPointObject* self = (PyoaInterPointerAppDef_oaAnalysisOpPointObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAnalysisOpPoint_get_doc[] =
"Class: oaInterPointerAppDef_oaAnalysisOpPoint, Function: get\n"
" Paramegers: (oaAnalysisOpPoint)\n"
" Calls: oaObject* get(const oaAnalysisOpPoint* object)\n"
" Signature: get|ptr-oaObject|cptr-oaAnalysisOpPoint,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaAnalysisOpPoint_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaAnalysisOpPoint data;
int convert_status=PyoaInterPointerAppDef_oaAnalysisOpPoint_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaAnalysisOpPointObject* self=(PyoaInterPointerAppDef_oaAnalysisOpPointObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaAnalysisOpPoint p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaAnalysisOpPoint_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAnalysisOpPoint_set_doc[] =
"Class: oaInterPointerAppDef_oaAnalysisOpPoint, Function: set\n"
" Paramegers: (oaAnalysisOpPoint,oaObject)\n"
" Calls: void set(oaAnalysisOpPoint* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaAnalysisOpPoint,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaAnalysisOpPoint_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaAnalysisOpPoint data;
int convert_status=PyoaInterPointerAppDef_oaAnalysisOpPoint_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaAnalysisOpPointObject* self=(PyoaInterPointerAppDef_oaAnalysisOpPointObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaAnalysisOpPoint p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaAnalysisOpPoint_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAnalysisOpPoint_isNull_doc[] =
"Class: oaInterPointerAppDef_oaAnalysisOpPoint, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaAnalysisOpPoint_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaAnalysisOpPoint data;
int convert_status=PyoaInterPointerAppDef_oaAnalysisOpPoint_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaAnalysisOpPoint_assign_doc[] =
"Class: oaInterPointerAppDef_oaAnalysisOpPoint, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaAnalysisOpPoint_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaAnalysisOpPoint data;
int convert_status=PyoaInterPointerAppDef_oaAnalysisOpPoint_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaAnalysisOpPoint p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaAnalysisOpPoint_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaAnalysisOpPoint_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaAnalysisOpPoint_get,METH_VARARGS,oaInterPointerAppDef_oaAnalysisOpPoint_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaAnalysisOpPoint_set,METH_VARARGS,oaInterPointerAppDef_oaAnalysisOpPoint_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaAnalysisOpPoint_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaAnalysisOpPoint_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaAnalysisOpPoint_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaAnalysisOpPoint_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAnalysisOpPoint_doc[] =
"Class: oaInterPointerAppDef_oaAnalysisOpPoint\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaAnalysisOpPoint)\n"
" Calls: (const oaInterPointerAppDef_oaAnalysisOpPoint&)\n"
" Signature: oaInterPointerAppDef_oaAnalysisOpPoint||cref-oaInterPointerAppDef_oaAnalysisOpPoint,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaAnalysisOpPoint_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaAnalysisOpPoint",
sizeof(PyoaInterPointerAppDef_oaAnalysisOpPointObject),
0,
(destructor)oaInterPointerAppDef_oaAnalysisOpPoint_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaAnalysisOpPoint_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaAnalysisOpPoint_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaAnalysisOpPoint_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaAnalysisOpPoint_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaAnalysisOpPoint_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAnalysisOpPoint_static_find_doc[] =
"Class: oaInterPointerAppDef_oaAnalysisOpPoint, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaAnalysisOpPoint* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaAnalysisOpPoint|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaAnalysisOpPoint* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaAnalysisOpPoint|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaAnalysisOpPoint_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaAnalysisOpPointp result= (oaInterPointerAppDef_oaAnalysisOpPoint::find(p1.Data()));
return PyoaInterPointerAppDef_oaAnalysisOpPoint_FromoaInterPointerAppDef_oaAnalysisOpPoint(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaAnalysisOpPointp result= (oaInterPointerAppDef_oaAnalysisOpPoint::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaAnalysisOpPoint_FromoaInterPointerAppDef_oaAnalysisOpPoint(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaAnalysisOpPoint, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAnalysisOpPoint_static_get_doc[] =
"Class: oaInterPointerAppDef_oaAnalysisOpPoint, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaAnalysisOpPoint* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaAnalysisOpPoint|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaAnalysisOpPoint* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaAnalysisOpPoint|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaAnalysisOpPoint* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaAnalysisOpPoint|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaAnalysisOpPoint* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaAnalysisOpPoint|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaAnalysisOpPoint_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaAnalysisOpPointp result= (oaInterPointerAppDef_oaAnalysisOpPoint::get(p1.Data()));
return PyoaInterPointerAppDef_oaAnalysisOpPoint_FromoaInterPointerAppDef_oaAnalysisOpPoint(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaAnalysisOpPointp result= (oaInterPointerAppDef_oaAnalysisOpPoint::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaAnalysisOpPoint_FromoaInterPointerAppDef_oaAnalysisOpPoint(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaAnalysisOpPointp result= (oaInterPointerAppDef_oaAnalysisOpPoint::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaAnalysisOpPoint_FromoaInterPointerAppDef_oaAnalysisOpPoint(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaAnalysisOpPointp result= (oaInterPointerAppDef_oaAnalysisOpPoint::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaAnalysisOpPoint_FromoaInterPointerAppDef_oaAnalysisOpPoint(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaAnalysisOpPoint, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaAnalysisOpPoint_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaAnalysisOpPoint_static_find,METH_VARARGS,oaInterPointerAppDef_oaAnalysisOpPoint_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaAnalysisOpPoint_static_get,METH_VARARGS,oaInterPointerAppDef_oaAnalysisOpPoint_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaAnalysisOpPoint_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaAnalysisOpPoint_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaAnalysisOpPoint\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaAnalysisOpPoint",
(PyObject*)(&PyoaInterPointerAppDef_oaAnalysisOpPoint_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaAnalysisOpPoint\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaAnalysisOpPoint_Type.tp_dict;
for(method=oaInterPointerAppDef_oaAnalysisOpPoint_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaAnalysisPoint
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaAnalysisPoint_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaAnalysisPoint_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaAnalysisPointObject* self = (PyoaInterPointerAppDef_oaAnalysisPointObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaAnalysisPoint)
{
PyParamoaInterPointerAppDef_oaAnalysisPoint p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaAnalysisPoint_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaAnalysisPoint, Choices are:\n"
" (oaInterPointerAppDef_oaAnalysisPoint)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaAnalysisPoint_tp_dealloc(PyoaInterPointerAppDef_oaAnalysisPointObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaAnalysisPoint_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaAnalysisPoint value;
int convert_status=PyoaInterPointerAppDef_oaAnalysisPoint_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[58];
sprintf(buffer,"<oaInterPointerAppDef_oaAnalysisPoint::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaAnalysisPoint_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaAnalysisPoint v1;
PyParamoaInterPointerAppDef_oaAnalysisPoint v2;
int convert_status1=PyoaInterPointerAppDef_oaAnalysisPoint_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaAnalysisPoint_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaAnalysisPoint_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaAnalysisPoint* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaAnalysisPoint_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaAnalysisPoint**) ((PyoaInterPointerAppDef_oaAnalysisPointObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaAnalysisPoint Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaAnalysisPoint_FromoaInterPointerAppDef_oaAnalysisPoint(oaInterPointerAppDef_oaAnalysisPoint** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaAnalysisPoint* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaAnalysisPoint_Type.tp_alloc(&PyoaInterPointerAppDef_oaAnalysisPoint_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaAnalysisPointObject* self = (PyoaInterPointerAppDef_oaAnalysisPointObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaAnalysisPoint_FromoaInterPointerAppDef_oaAnalysisPoint(oaInterPointerAppDef_oaAnalysisPoint* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaAnalysisPoint_Type.tp_alloc(&PyoaInterPointerAppDef_oaAnalysisPoint_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaAnalysisPointObject* self = (PyoaInterPointerAppDef_oaAnalysisPointObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAnalysisPoint_get_doc[] =
"Class: oaInterPointerAppDef_oaAnalysisPoint, Function: get\n"
" Paramegers: (oaAnalysisPoint)\n"
" Calls: oaObject* get(const oaAnalysisPoint* object)\n"
" Signature: get|ptr-oaObject|cptr-oaAnalysisPoint,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaAnalysisPoint_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaAnalysisPoint data;
int convert_status=PyoaInterPointerAppDef_oaAnalysisPoint_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaAnalysisPointObject* self=(PyoaInterPointerAppDef_oaAnalysisPointObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaAnalysisPoint p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaAnalysisPoint_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAnalysisPoint_set_doc[] =
"Class: oaInterPointerAppDef_oaAnalysisPoint, Function: set\n"
" Paramegers: (oaAnalysisPoint,oaObject)\n"
" Calls: void set(oaAnalysisPoint* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaAnalysisPoint,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaAnalysisPoint_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaAnalysisPoint data;
int convert_status=PyoaInterPointerAppDef_oaAnalysisPoint_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaAnalysisPointObject* self=(PyoaInterPointerAppDef_oaAnalysisPointObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaAnalysisPoint p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaAnalysisPoint_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAnalysisPoint_isNull_doc[] =
"Class: oaInterPointerAppDef_oaAnalysisPoint, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaAnalysisPoint_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaAnalysisPoint data;
int convert_status=PyoaInterPointerAppDef_oaAnalysisPoint_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaAnalysisPoint_assign_doc[] =
"Class: oaInterPointerAppDef_oaAnalysisPoint, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaAnalysisPoint_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaAnalysisPoint data;
int convert_status=PyoaInterPointerAppDef_oaAnalysisPoint_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaAnalysisPoint p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaAnalysisPoint_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaAnalysisPoint_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaAnalysisPoint_get,METH_VARARGS,oaInterPointerAppDef_oaAnalysisPoint_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaAnalysisPoint_set,METH_VARARGS,oaInterPointerAppDef_oaAnalysisPoint_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaAnalysisPoint_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaAnalysisPoint_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaAnalysisPoint_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaAnalysisPoint_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAnalysisPoint_doc[] =
"Class: oaInterPointerAppDef_oaAnalysisPoint\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaAnalysisPoint)\n"
" Calls: (const oaInterPointerAppDef_oaAnalysisPoint&)\n"
" Signature: oaInterPointerAppDef_oaAnalysisPoint||cref-oaInterPointerAppDef_oaAnalysisPoint,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaAnalysisPoint_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaAnalysisPoint",
sizeof(PyoaInterPointerAppDef_oaAnalysisPointObject),
0,
(destructor)oaInterPointerAppDef_oaAnalysisPoint_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaAnalysisPoint_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaAnalysisPoint_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaAnalysisPoint_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaAnalysisPoint_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaAnalysisPoint_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAnalysisPoint_static_find_doc[] =
"Class: oaInterPointerAppDef_oaAnalysisPoint, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaAnalysisPoint* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaAnalysisPoint|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaAnalysisPoint* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaAnalysisPoint|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaAnalysisPoint_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaAnalysisPointp result= (oaInterPointerAppDef_oaAnalysisPoint::find(p1.Data()));
return PyoaInterPointerAppDef_oaAnalysisPoint_FromoaInterPointerAppDef_oaAnalysisPoint(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaAnalysisPointp result= (oaInterPointerAppDef_oaAnalysisPoint::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaAnalysisPoint_FromoaInterPointerAppDef_oaAnalysisPoint(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaAnalysisPoint, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAnalysisPoint_static_get_doc[] =
"Class: oaInterPointerAppDef_oaAnalysisPoint, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaAnalysisPoint* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaAnalysisPoint|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaAnalysisPoint* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaAnalysisPoint|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaAnalysisPoint* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaAnalysisPoint|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaAnalysisPoint* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaAnalysisPoint|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaAnalysisPoint_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaAnalysisPointp result= (oaInterPointerAppDef_oaAnalysisPoint::get(p1.Data()));
return PyoaInterPointerAppDef_oaAnalysisPoint_FromoaInterPointerAppDef_oaAnalysisPoint(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaAnalysisPointp result= (oaInterPointerAppDef_oaAnalysisPoint::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaAnalysisPoint_FromoaInterPointerAppDef_oaAnalysisPoint(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaAnalysisPointp result= (oaInterPointerAppDef_oaAnalysisPoint::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaAnalysisPoint_FromoaInterPointerAppDef_oaAnalysisPoint(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaAnalysisPointp result= (oaInterPointerAppDef_oaAnalysisPoint::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaAnalysisPoint_FromoaInterPointerAppDef_oaAnalysisPoint(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaAnalysisPoint, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaAnalysisPoint_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaAnalysisPoint_static_find,METH_VARARGS,oaInterPointerAppDef_oaAnalysisPoint_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaAnalysisPoint_static_get,METH_VARARGS,oaInterPointerAppDef_oaAnalysisPoint_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaAnalysisPoint_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaAnalysisPoint_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaAnalysisPoint\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaAnalysisPoint",
(PyObject*)(&PyoaInterPointerAppDef_oaAnalysisPoint_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaAnalysisPoint\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaAnalysisPoint_Type.tp_dict;
for(method=oaInterPointerAppDef_oaAnalysisPoint_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaAppObject
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaAppObject_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaAppObject_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaAppObjectObject* self = (PyoaInterPointerAppDef_oaAppObjectObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaAppObject)
{
PyParamoaInterPointerAppDef_oaAppObject p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaAppObject_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaAppObject, Choices are:\n"
" (oaInterPointerAppDef_oaAppObject)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaAppObject_tp_dealloc(PyoaInterPointerAppDef_oaAppObjectObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaAppObject_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaAppObject value;
int convert_status=PyoaInterPointerAppDef_oaAppObject_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[54];
sprintf(buffer,"<oaInterPointerAppDef_oaAppObject::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaAppObject_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaAppObject v1;
PyParamoaInterPointerAppDef_oaAppObject v2;
int convert_status1=PyoaInterPointerAppDef_oaAppObject_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaAppObject_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaAppObject_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaAppObject* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaAppObject_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaAppObject**) ((PyoaInterPointerAppDef_oaAppObjectObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaAppObject Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaAppObject_FromoaInterPointerAppDef_oaAppObject(oaInterPointerAppDef_oaAppObject** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaAppObject* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaAppObject_Type.tp_alloc(&PyoaInterPointerAppDef_oaAppObject_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaAppObjectObject* self = (PyoaInterPointerAppDef_oaAppObjectObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaAppObject_FromoaInterPointerAppDef_oaAppObject(oaInterPointerAppDef_oaAppObject* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaAppObject_Type.tp_alloc(&PyoaInterPointerAppDef_oaAppObject_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaAppObjectObject* self = (PyoaInterPointerAppDef_oaAppObjectObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAppObject_get_doc[] =
"Class: oaInterPointerAppDef_oaAppObject, Function: get\n"
" Paramegers: (oaAppObject)\n"
" Calls: oaObject* get(const oaAppObject* object)\n"
" Signature: get|ptr-oaObject|cptr-oaAppObject,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaAppObject_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaAppObject data;
int convert_status=PyoaInterPointerAppDef_oaAppObject_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaAppObjectObject* self=(PyoaInterPointerAppDef_oaAppObjectObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaAppObject p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaAppObject_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAppObject_set_doc[] =
"Class: oaInterPointerAppDef_oaAppObject, Function: set\n"
" Paramegers: (oaAppObject,oaObject)\n"
" Calls: void set(oaAppObject* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaAppObject,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaAppObject_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaAppObject data;
int convert_status=PyoaInterPointerAppDef_oaAppObject_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaAppObjectObject* self=(PyoaInterPointerAppDef_oaAppObjectObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaAppObject p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaAppObject_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAppObject_isNull_doc[] =
"Class: oaInterPointerAppDef_oaAppObject, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaAppObject_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaAppObject data;
int convert_status=PyoaInterPointerAppDef_oaAppObject_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaAppObject_assign_doc[] =
"Class: oaInterPointerAppDef_oaAppObject, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaAppObject_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaAppObject data;
int convert_status=PyoaInterPointerAppDef_oaAppObject_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaAppObject p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaAppObject_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaAppObject_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaAppObject_get,METH_VARARGS,oaInterPointerAppDef_oaAppObject_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaAppObject_set,METH_VARARGS,oaInterPointerAppDef_oaAppObject_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaAppObject_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaAppObject_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaAppObject_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaAppObject_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAppObject_doc[] =
"Class: oaInterPointerAppDef_oaAppObject\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaAppObject)\n"
" Calls: (const oaInterPointerAppDef_oaAppObject&)\n"
" Signature: oaInterPointerAppDef_oaAppObject||cref-oaInterPointerAppDef_oaAppObject,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaAppObject_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaAppObject",
sizeof(PyoaInterPointerAppDef_oaAppObjectObject),
0,
(destructor)oaInterPointerAppDef_oaAppObject_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaAppObject_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaAppObject_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaAppObject_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaAppObject_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaAppObject_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAppObject_static_find_doc[] =
"Class: oaInterPointerAppDef_oaAppObject, Function: find\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaAppObject* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaAppObject|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaAppObject_static_find(PyObject* ob, PyObject *args)
{
try {
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaAppObjectp result= (oaInterPointerAppDef_oaAppObject::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaAppObject_FromoaInterPointerAppDef_oaAppObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAppObject_static_get_doc[] =
"Class: oaInterPointerAppDef_oaAppObject, Function: get\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaAppObject* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaAppObject|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaAppObject* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaAppObject|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaAppObject_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaAppObjectp result= (oaInterPointerAppDef_oaAppObject::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaAppObject_FromoaInterPointerAppDef_oaAppObject(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaAppObjectp result= (oaInterPointerAppDef_oaAppObject::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaAppObject_FromoaInterPointerAppDef_oaAppObject(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaAppObject, function: get, Choices are:\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaAppObject_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaAppObject_static_find,METH_VARARGS,oaInterPointerAppDef_oaAppObject_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaAppObject_static_get,METH_VARARGS,oaInterPointerAppDef_oaAppObject_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaAppObject_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaAppObject_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaAppObject\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaAppObject",
(PyObject*)(&PyoaInterPointerAppDef_oaAppObject_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaAppObject\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaAppObject_Type.tp_dict;
for(method=oaInterPointerAppDef_oaAppObject_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaAssignment
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaAssignment_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaAssignment_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaAssignmentObject* self = (PyoaInterPointerAppDef_oaAssignmentObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaAssignment)
{
PyParamoaInterPointerAppDef_oaAssignment p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaAssignment_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaAssignment, Choices are:\n"
" (oaInterPointerAppDef_oaAssignment)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaAssignment_tp_dealloc(PyoaInterPointerAppDef_oaAssignmentObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaAssignment_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaAssignment value;
int convert_status=PyoaInterPointerAppDef_oaAssignment_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[55];
sprintf(buffer,"<oaInterPointerAppDef_oaAssignment::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaAssignment_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaAssignment v1;
PyParamoaInterPointerAppDef_oaAssignment v2;
int convert_status1=PyoaInterPointerAppDef_oaAssignment_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaAssignment_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaAssignment_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaAssignment* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaAssignment_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaAssignment**) ((PyoaInterPointerAppDef_oaAssignmentObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaAssignment Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaAssignment_FromoaInterPointerAppDef_oaAssignment(oaInterPointerAppDef_oaAssignment** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaAssignment* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaAssignment_Type.tp_alloc(&PyoaInterPointerAppDef_oaAssignment_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaAssignmentObject* self = (PyoaInterPointerAppDef_oaAssignmentObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaAssignment_FromoaInterPointerAppDef_oaAssignment(oaInterPointerAppDef_oaAssignment* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaAssignment_Type.tp_alloc(&PyoaInterPointerAppDef_oaAssignment_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaAssignmentObject* self = (PyoaInterPointerAppDef_oaAssignmentObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAssignment_get_doc[] =
"Class: oaInterPointerAppDef_oaAssignment, Function: get\n"
" Paramegers: (oaAssignment)\n"
" Calls: oaObject* get(const oaAssignment* object)\n"
" Signature: get|ptr-oaObject|cptr-oaAssignment,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaAssignment_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaAssignment data;
int convert_status=PyoaInterPointerAppDef_oaAssignment_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaAssignmentObject* self=(PyoaInterPointerAppDef_oaAssignmentObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaAssignment p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaAssignment_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAssignment_set_doc[] =
"Class: oaInterPointerAppDef_oaAssignment, Function: set\n"
" Paramegers: (oaAssignment,oaObject)\n"
" Calls: void set(oaAssignment* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaAssignment,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaAssignment_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaAssignment data;
int convert_status=PyoaInterPointerAppDef_oaAssignment_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaAssignmentObject* self=(PyoaInterPointerAppDef_oaAssignmentObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaAssignment p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaAssignment_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAssignment_isNull_doc[] =
"Class: oaInterPointerAppDef_oaAssignment, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaAssignment_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaAssignment data;
int convert_status=PyoaInterPointerAppDef_oaAssignment_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaAssignment_assign_doc[] =
"Class: oaInterPointerAppDef_oaAssignment, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaAssignment_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaAssignment data;
int convert_status=PyoaInterPointerAppDef_oaAssignment_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaAssignment p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaAssignment_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaAssignment_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaAssignment_get,METH_VARARGS,oaInterPointerAppDef_oaAssignment_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaAssignment_set,METH_VARARGS,oaInterPointerAppDef_oaAssignment_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaAssignment_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaAssignment_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaAssignment_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaAssignment_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAssignment_doc[] =
"Class: oaInterPointerAppDef_oaAssignment\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaAssignment)\n"
" Calls: (const oaInterPointerAppDef_oaAssignment&)\n"
" Signature: oaInterPointerAppDef_oaAssignment||cref-oaInterPointerAppDef_oaAssignment,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaAssignment_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaAssignment",
sizeof(PyoaInterPointerAppDef_oaAssignmentObject),
0,
(destructor)oaInterPointerAppDef_oaAssignment_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaAssignment_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaAssignment_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaAssignment_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaAssignment_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaAssignment_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAssignment_static_find_doc[] =
"Class: oaInterPointerAppDef_oaAssignment, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaAssignment* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaAssignment|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaAssignment* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaAssignment|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaAssignment_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaAssignmentp result= (oaInterPointerAppDef_oaAssignment::find(p1.Data()));
return PyoaInterPointerAppDef_oaAssignment_FromoaInterPointerAppDef_oaAssignment(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaAssignmentp result= (oaInterPointerAppDef_oaAssignment::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaAssignment_FromoaInterPointerAppDef_oaAssignment(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaAssignment, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaAssignment_static_get_doc[] =
"Class: oaInterPointerAppDef_oaAssignment, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaAssignment* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaAssignment|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaAssignment* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaAssignment|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaAssignment* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaAssignment|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaAssignment* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaAssignment|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaAssignment_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaAssignmentp result= (oaInterPointerAppDef_oaAssignment::get(p1.Data()));
return PyoaInterPointerAppDef_oaAssignment_FromoaInterPointerAppDef_oaAssignment(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaAssignmentp result= (oaInterPointerAppDef_oaAssignment::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaAssignment_FromoaInterPointerAppDef_oaAssignment(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaAssignmentp result= (oaInterPointerAppDef_oaAssignment::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaAssignment_FromoaInterPointerAppDef_oaAssignment(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaAssignmentp result= (oaInterPointerAppDef_oaAssignment::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaAssignment_FromoaInterPointerAppDef_oaAssignment(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaAssignment, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaAssignment_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaAssignment_static_find,METH_VARARGS,oaInterPointerAppDef_oaAssignment_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaAssignment_static_get,METH_VARARGS,oaInterPointerAppDef_oaAssignment_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaAssignment_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaAssignment_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaAssignment\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaAssignment",
(PyObject*)(&PyoaInterPointerAppDef_oaAssignment_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaAssignment\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaAssignment_Type.tp_dict;
for(method=oaInterPointerAppDef_oaAssignment_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaBlock
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaBlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaBlock_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaBlockObject* self = (PyoaInterPointerAppDef_oaBlockObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaBlock)
{
PyParamoaInterPointerAppDef_oaBlock p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaBlock_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaBlock, Choices are:\n"
" (oaInterPointerAppDef_oaBlock)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaBlock_tp_dealloc(PyoaInterPointerAppDef_oaBlockObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaBlock_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaBlock value;
int convert_status=PyoaInterPointerAppDef_oaBlock_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[50];
sprintf(buffer,"<oaInterPointerAppDef_oaBlock::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaBlock_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaBlock v1;
PyParamoaInterPointerAppDef_oaBlock v2;
int convert_status1=PyoaInterPointerAppDef_oaBlock_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaBlock_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaBlock_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaBlock* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaBlock_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaBlock**) ((PyoaInterPointerAppDef_oaBlockObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaBlock Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaBlock_FromoaInterPointerAppDef_oaBlock(oaInterPointerAppDef_oaBlock** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaBlock* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaBlock_Type.tp_alloc(&PyoaInterPointerAppDef_oaBlock_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaBlockObject* self = (PyoaInterPointerAppDef_oaBlockObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaBlock_FromoaInterPointerAppDef_oaBlock(oaInterPointerAppDef_oaBlock* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaBlock_Type.tp_alloc(&PyoaInterPointerAppDef_oaBlock_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaBlockObject* self = (PyoaInterPointerAppDef_oaBlockObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBlock_get_doc[] =
"Class: oaInterPointerAppDef_oaBlock, Function: get\n"
" Paramegers: (oaBlock)\n"
" Calls: oaObject* get(const oaBlock* object)\n"
" Signature: get|ptr-oaObject|cptr-oaBlock,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaBlock_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaBlock data;
int convert_status=PyoaInterPointerAppDef_oaBlock_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaBlockObject* self=(PyoaInterPointerAppDef_oaBlockObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaBlock p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaBlock_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBlock_set_doc[] =
"Class: oaInterPointerAppDef_oaBlock, Function: set\n"
" Paramegers: (oaBlock,oaObject)\n"
" Calls: void set(oaBlock* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaBlock,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaBlock_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaBlock data;
int convert_status=PyoaInterPointerAppDef_oaBlock_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaBlockObject* self=(PyoaInterPointerAppDef_oaBlockObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaBlock p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaBlock_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBlock_isNull_doc[] =
"Class: oaInterPointerAppDef_oaBlock, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaBlock_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaBlock data;
int convert_status=PyoaInterPointerAppDef_oaBlock_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaBlock_assign_doc[] =
"Class: oaInterPointerAppDef_oaBlock, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaBlock_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaBlock data;
int convert_status=PyoaInterPointerAppDef_oaBlock_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaBlock p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaBlock_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaBlock_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaBlock_get,METH_VARARGS,oaInterPointerAppDef_oaBlock_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaBlock_set,METH_VARARGS,oaInterPointerAppDef_oaBlock_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaBlock_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaBlock_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaBlock_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaBlock_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBlock_doc[] =
"Class: oaInterPointerAppDef_oaBlock\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaBlock)\n"
" Calls: (const oaInterPointerAppDef_oaBlock&)\n"
" Signature: oaInterPointerAppDef_oaBlock||cref-oaInterPointerAppDef_oaBlock,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaBlock_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaBlock",
sizeof(PyoaInterPointerAppDef_oaBlockObject),
0,
(destructor)oaInterPointerAppDef_oaBlock_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaBlock_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaBlock_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaBlock_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaBlock_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaBlock_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBlock_static_find_doc[] =
"Class: oaInterPointerAppDef_oaBlock, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaBlock* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaBlock|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaBlock* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaBlock|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaBlock_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaBlockp result= (oaInterPointerAppDef_oaBlock::find(p1.Data()));
return PyoaInterPointerAppDef_oaBlock_FromoaInterPointerAppDef_oaBlock(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaBlockp result= (oaInterPointerAppDef_oaBlock::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaBlock_FromoaInterPointerAppDef_oaBlock(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaBlock, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBlock_static_get_doc[] =
"Class: oaInterPointerAppDef_oaBlock, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaBlock* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBlock|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaBlock* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBlock|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaBlock* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBlock|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaBlock* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBlock|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaBlock_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaBlockp result= (oaInterPointerAppDef_oaBlock::get(p1.Data()));
return PyoaInterPointerAppDef_oaBlock_FromoaInterPointerAppDef_oaBlock(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaBlockp result= (oaInterPointerAppDef_oaBlock::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaBlock_FromoaInterPointerAppDef_oaBlock(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaBlockp result= (oaInterPointerAppDef_oaBlock::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaBlock_FromoaInterPointerAppDef_oaBlock(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaBlockp result= (oaInterPointerAppDef_oaBlock::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaBlock_FromoaInterPointerAppDef_oaBlock(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaBlock, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaBlock_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaBlock_static_find,METH_VARARGS,oaInterPointerAppDef_oaBlock_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaBlock_static_get,METH_VARARGS,oaInterPointerAppDef_oaBlock_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaBlock_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaBlock_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaBlock\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaBlock",
(PyObject*)(&PyoaInterPointerAppDef_oaBlock_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaBlock\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaBlock_Type.tp_dict;
for(method=oaInterPointerAppDef_oaBlock_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaBlockage
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaBlockage_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaBlockage_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaBlockageObject* self = (PyoaInterPointerAppDef_oaBlockageObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaBlockage)
{
PyParamoaInterPointerAppDef_oaBlockage p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaBlockage_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaBlockage, Choices are:\n"
" (oaInterPointerAppDef_oaBlockage)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaBlockage_tp_dealloc(PyoaInterPointerAppDef_oaBlockageObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaBlockage_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaBlockage value;
int convert_status=PyoaInterPointerAppDef_oaBlockage_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[53];
sprintf(buffer,"<oaInterPointerAppDef_oaBlockage::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaBlockage_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaBlockage v1;
PyParamoaInterPointerAppDef_oaBlockage v2;
int convert_status1=PyoaInterPointerAppDef_oaBlockage_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaBlockage_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaBlockage_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaBlockage* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaBlockage_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaBlockage**) ((PyoaInterPointerAppDef_oaBlockageObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaBlockage Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaBlockage_FromoaInterPointerAppDef_oaBlockage(oaInterPointerAppDef_oaBlockage** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaBlockage* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaBlockage_Type.tp_alloc(&PyoaInterPointerAppDef_oaBlockage_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaBlockageObject* self = (PyoaInterPointerAppDef_oaBlockageObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaBlockage_FromoaInterPointerAppDef_oaBlockage(oaInterPointerAppDef_oaBlockage* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaBlockage_Type.tp_alloc(&PyoaInterPointerAppDef_oaBlockage_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaBlockageObject* self = (PyoaInterPointerAppDef_oaBlockageObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBlockage_get_doc[] =
"Class: oaInterPointerAppDef_oaBlockage, Function: get\n"
" Paramegers: (oaBlockage)\n"
" Calls: oaObject* get(const oaBlockage* object)\n"
" Signature: get|ptr-oaObject|cptr-oaBlockage,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaBlockage_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaBlockage data;
int convert_status=PyoaInterPointerAppDef_oaBlockage_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaBlockageObject* self=(PyoaInterPointerAppDef_oaBlockageObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaBlockage p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaBlockage_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBlockage_set_doc[] =
"Class: oaInterPointerAppDef_oaBlockage, Function: set\n"
" Paramegers: (oaBlockage,oaObject)\n"
" Calls: void set(oaBlockage* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaBlockage,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaBlockage_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaBlockage data;
int convert_status=PyoaInterPointerAppDef_oaBlockage_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaBlockageObject* self=(PyoaInterPointerAppDef_oaBlockageObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaBlockage p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaBlockage_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBlockage_isNull_doc[] =
"Class: oaInterPointerAppDef_oaBlockage, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaBlockage_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaBlockage data;
int convert_status=PyoaInterPointerAppDef_oaBlockage_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaBlockage_assign_doc[] =
"Class: oaInterPointerAppDef_oaBlockage, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaBlockage_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaBlockage data;
int convert_status=PyoaInterPointerAppDef_oaBlockage_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaBlockage p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaBlockage_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaBlockage_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaBlockage_get,METH_VARARGS,oaInterPointerAppDef_oaBlockage_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaBlockage_set,METH_VARARGS,oaInterPointerAppDef_oaBlockage_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaBlockage_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaBlockage_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaBlockage_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaBlockage_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBlockage_doc[] =
"Class: oaInterPointerAppDef_oaBlockage\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaBlockage)\n"
" Calls: (const oaInterPointerAppDef_oaBlockage&)\n"
" Signature: oaInterPointerAppDef_oaBlockage||cref-oaInterPointerAppDef_oaBlockage,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaBlockage_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaBlockage",
sizeof(PyoaInterPointerAppDef_oaBlockageObject),
0,
(destructor)oaInterPointerAppDef_oaBlockage_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaBlockage_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaBlockage_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaBlockage_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaBlockage_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaBlockage_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBlockage_static_find_doc[] =
"Class: oaInterPointerAppDef_oaBlockage, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaBlockage* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaBlockage|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaBlockage* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaBlockage|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaBlockage_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaBlockagep result= (oaInterPointerAppDef_oaBlockage::find(p1.Data()));
return PyoaInterPointerAppDef_oaBlockage_FromoaInterPointerAppDef_oaBlockage(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaBlockagep result= (oaInterPointerAppDef_oaBlockage::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaBlockage_FromoaInterPointerAppDef_oaBlockage(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaBlockage, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBlockage_static_get_doc[] =
"Class: oaInterPointerAppDef_oaBlockage, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaBlockage* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBlockage|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaBlockage* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBlockage|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaBlockage* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBlockage|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaBlockage* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBlockage|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaBlockage_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaBlockagep result= (oaInterPointerAppDef_oaBlockage::get(p1.Data()));
return PyoaInterPointerAppDef_oaBlockage_FromoaInterPointerAppDef_oaBlockage(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaBlockagep result= (oaInterPointerAppDef_oaBlockage::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaBlockage_FromoaInterPointerAppDef_oaBlockage(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaBlockagep result= (oaInterPointerAppDef_oaBlockage::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaBlockage_FromoaInterPointerAppDef_oaBlockage(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaBlockagep result= (oaInterPointerAppDef_oaBlockage::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaBlockage_FromoaInterPointerAppDef_oaBlockage(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaBlockage, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaBlockage_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaBlockage_static_find,METH_VARARGS,oaInterPointerAppDef_oaBlockage_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaBlockage_static_get,METH_VARARGS,oaInterPointerAppDef_oaBlockage_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaBlockage_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaBlockage_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaBlockage\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaBlockage",
(PyObject*)(&PyoaInterPointerAppDef_oaBlockage_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaBlockage\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaBlockage_Type.tp_dict;
for(method=oaInterPointerAppDef_oaBlockage_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaBoundary
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaBoundary_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaBoundary_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaBoundaryObject* self = (PyoaInterPointerAppDef_oaBoundaryObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaBoundary)
{
PyParamoaInterPointerAppDef_oaBoundary p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaBoundary_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaBoundary, Choices are:\n"
" (oaInterPointerAppDef_oaBoundary)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaBoundary_tp_dealloc(PyoaInterPointerAppDef_oaBoundaryObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaBoundary_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaBoundary value;
int convert_status=PyoaInterPointerAppDef_oaBoundary_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[53];
sprintf(buffer,"<oaInterPointerAppDef_oaBoundary::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaBoundary_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaBoundary v1;
PyParamoaInterPointerAppDef_oaBoundary v2;
int convert_status1=PyoaInterPointerAppDef_oaBoundary_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaBoundary_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaBoundary_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaBoundary* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaBoundary_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaBoundary**) ((PyoaInterPointerAppDef_oaBoundaryObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaBoundary Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaBoundary_FromoaInterPointerAppDef_oaBoundary(oaInterPointerAppDef_oaBoundary** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaBoundary* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaBoundary_Type.tp_alloc(&PyoaInterPointerAppDef_oaBoundary_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaBoundaryObject* self = (PyoaInterPointerAppDef_oaBoundaryObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaBoundary_FromoaInterPointerAppDef_oaBoundary(oaInterPointerAppDef_oaBoundary* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaBoundary_Type.tp_alloc(&PyoaInterPointerAppDef_oaBoundary_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaBoundaryObject* self = (PyoaInterPointerAppDef_oaBoundaryObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBoundary_get_doc[] =
"Class: oaInterPointerAppDef_oaBoundary, Function: get\n"
" Paramegers: (oaBoundary)\n"
" Calls: oaObject* get(const oaBoundary* object)\n"
" Signature: get|ptr-oaObject|cptr-oaBoundary,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaBoundary_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaBoundary data;
int convert_status=PyoaInterPointerAppDef_oaBoundary_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaBoundaryObject* self=(PyoaInterPointerAppDef_oaBoundaryObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaBoundary p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaBoundary_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBoundary_set_doc[] =
"Class: oaInterPointerAppDef_oaBoundary, Function: set\n"
" Paramegers: (oaBoundary,oaObject)\n"
" Calls: void set(oaBoundary* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaBoundary,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaBoundary_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaBoundary data;
int convert_status=PyoaInterPointerAppDef_oaBoundary_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaBoundaryObject* self=(PyoaInterPointerAppDef_oaBoundaryObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaBoundary p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaBoundary_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBoundary_isNull_doc[] =
"Class: oaInterPointerAppDef_oaBoundary, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaBoundary_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaBoundary data;
int convert_status=PyoaInterPointerAppDef_oaBoundary_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaBoundary_assign_doc[] =
"Class: oaInterPointerAppDef_oaBoundary, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaBoundary_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaBoundary data;
int convert_status=PyoaInterPointerAppDef_oaBoundary_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaBoundary p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaBoundary_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaBoundary_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaBoundary_get,METH_VARARGS,oaInterPointerAppDef_oaBoundary_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaBoundary_set,METH_VARARGS,oaInterPointerAppDef_oaBoundary_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaBoundary_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaBoundary_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaBoundary_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaBoundary_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBoundary_doc[] =
"Class: oaInterPointerAppDef_oaBoundary\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaBoundary)\n"
" Calls: (const oaInterPointerAppDef_oaBoundary&)\n"
" Signature: oaInterPointerAppDef_oaBoundary||cref-oaInterPointerAppDef_oaBoundary,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaBoundary_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaBoundary",
sizeof(PyoaInterPointerAppDef_oaBoundaryObject),
0,
(destructor)oaInterPointerAppDef_oaBoundary_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaBoundary_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaBoundary_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaBoundary_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaBoundary_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaBoundary_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBoundary_static_find_doc[] =
"Class: oaInterPointerAppDef_oaBoundary, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaBoundary* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaBoundary|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaBoundary* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaBoundary|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaBoundary_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaBoundaryp result= (oaInterPointerAppDef_oaBoundary::find(p1.Data()));
return PyoaInterPointerAppDef_oaBoundary_FromoaInterPointerAppDef_oaBoundary(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaBoundaryp result= (oaInterPointerAppDef_oaBoundary::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaBoundary_FromoaInterPointerAppDef_oaBoundary(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaBoundary, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBoundary_static_get_doc[] =
"Class: oaInterPointerAppDef_oaBoundary, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaBoundary* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBoundary|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaBoundary* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBoundary|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaBoundary* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBoundary|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaBoundary* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBoundary|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaBoundary_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaBoundaryp result= (oaInterPointerAppDef_oaBoundary::get(p1.Data()));
return PyoaInterPointerAppDef_oaBoundary_FromoaInterPointerAppDef_oaBoundary(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaBoundaryp result= (oaInterPointerAppDef_oaBoundary::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaBoundary_FromoaInterPointerAppDef_oaBoundary(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaBoundaryp result= (oaInterPointerAppDef_oaBoundary::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaBoundary_FromoaInterPointerAppDef_oaBoundary(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaBoundaryp result= (oaInterPointerAppDef_oaBoundary::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaBoundary_FromoaInterPointerAppDef_oaBoundary(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaBoundary, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaBoundary_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaBoundary_static_find,METH_VARARGS,oaInterPointerAppDef_oaBoundary_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaBoundary_static_get,METH_VARARGS,oaInterPointerAppDef_oaBoundary_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaBoundary_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaBoundary_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaBoundary\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaBoundary",
(PyObject*)(&PyoaInterPointerAppDef_oaBoundary_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaBoundary\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaBoundary_Type.tp_dict;
for(method=oaInterPointerAppDef_oaBoundary_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaBusNetDef
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaBusNetDef_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaBusNetDef_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaBusNetDefObject* self = (PyoaInterPointerAppDef_oaBusNetDefObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaBusNetDef)
{
PyParamoaInterPointerAppDef_oaBusNetDef p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaBusNetDef_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaBusNetDef, Choices are:\n"
" (oaInterPointerAppDef_oaBusNetDef)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaBusNetDef_tp_dealloc(PyoaInterPointerAppDef_oaBusNetDefObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaBusNetDef_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaBusNetDef value;
int convert_status=PyoaInterPointerAppDef_oaBusNetDef_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[54];
sprintf(buffer,"<oaInterPointerAppDef_oaBusNetDef::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaBusNetDef_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaBusNetDef v1;
PyParamoaInterPointerAppDef_oaBusNetDef v2;
int convert_status1=PyoaInterPointerAppDef_oaBusNetDef_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaBusNetDef_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaBusNetDef_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaBusNetDef* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaBusNetDef_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaBusNetDef**) ((PyoaInterPointerAppDef_oaBusNetDefObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaBusNetDef Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaBusNetDef_FromoaInterPointerAppDef_oaBusNetDef(oaInterPointerAppDef_oaBusNetDef** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaBusNetDef* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaBusNetDef_Type.tp_alloc(&PyoaInterPointerAppDef_oaBusNetDef_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaBusNetDefObject* self = (PyoaInterPointerAppDef_oaBusNetDefObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaBusNetDef_FromoaInterPointerAppDef_oaBusNetDef(oaInterPointerAppDef_oaBusNetDef* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaBusNetDef_Type.tp_alloc(&PyoaInterPointerAppDef_oaBusNetDef_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaBusNetDefObject* self = (PyoaInterPointerAppDef_oaBusNetDefObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBusNetDef_get_doc[] =
"Class: oaInterPointerAppDef_oaBusNetDef, Function: get\n"
" Paramegers: (oaBusNetDef)\n"
" Calls: oaObject* get(const oaBusNetDef* object)\n"
" Signature: get|ptr-oaObject|cptr-oaBusNetDef,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaBusNetDef_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaBusNetDef data;
int convert_status=PyoaInterPointerAppDef_oaBusNetDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaBusNetDefObject* self=(PyoaInterPointerAppDef_oaBusNetDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaBusNetDef p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaBusNetDef_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBusNetDef_set_doc[] =
"Class: oaInterPointerAppDef_oaBusNetDef, Function: set\n"
" Paramegers: (oaBusNetDef,oaObject)\n"
" Calls: void set(oaBusNetDef* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaBusNetDef,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaBusNetDef_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaBusNetDef data;
int convert_status=PyoaInterPointerAppDef_oaBusNetDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaBusNetDefObject* self=(PyoaInterPointerAppDef_oaBusNetDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaBusNetDef p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaBusNetDef_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBusNetDef_isNull_doc[] =
"Class: oaInterPointerAppDef_oaBusNetDef, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaBusNetDef_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaBusNetDef data;
int convert_status=PyoaInterPointerAppDef_oaBusNetDef_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaBusNetDef_assign_doc[] =
"Class: oaInterPointerAppDef_oaBusNetDef, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaBusNetDef_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaBusNetDef data;
int convert_status=PyoaInterPointerAppDef_oaBusNetDef_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaBusNetDef p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaBusNetDef_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaBusNetDef_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaBusNetDef_get,METH_VARARGS,oaInterPointerAppDef_oaBusNetDef_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaBusNetDef_set,METH_VARARGS,oaInterPointerAppDef_oaBusNetDef_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaBusNetDef_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaBusNetDef_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaBusNetDef_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaBusNetDef_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBusNetDef_doc[] =
"Class: oaInterPointerAppDef_oaBusNetDef\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaBusNetDef)\n"
" Calls: (const oaInterPointerAppDef_oaBusNetDef&)\n"
" Signature: oaInterPointerAppDef_oaBusNetDef||cref-oaInterPointerAppDef_oaBusNetDef,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaBusNetDef_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaBusNetDef",
sizeof(PyoaInterPointerAppDef_oaBusNetDefObject),
0,
(destructor)oaInterPointerAppDef_oaBusNetDef_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaBusNetDef_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaBusNetDef_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaBusNetDef_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaBusNetDef_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaBusNetDef_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBusNetDef_static_find_doc[] =
"Class: oaInterPointerAppDef_oaBusNetDef, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaBusNetDef* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaBusNetDef|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaBusNetDef* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaBusNetDef|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaBusNetDef_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaBusNetDefp result= (oaInterPointerAppDef_oaBusNetDef::find(p1.Data()));
return PyoaInterPointerAppDef_oaBusNetDef_FromoaInterPointerAppDef_oaBusNetDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaBusNetDefp result= (oaInterPointerAppDef_oaBusNetDef::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaBusNetDef_FromoaInterPointerAppDef_oaBusNetDef(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaBusNetDef, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBusNetDef_static_get_doc[] =
"Class: oaInterPointerAppDef_oaBusNetDef, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaBusNetDef* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBusNetDef|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaBusNetDef* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBusNetDef|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaBusNetDef* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBusNetDef|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaBusNetDef* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBusNetDef|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaBusNetDef_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaBusNetDefp result= (oaInterPointerAppDef_oaBusNetDef::get(p1.Data()));
return PyoaInterPointerAppDef_oaBusNetDef_FromoaInterPointerAppDef_oaBusNetDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaBusNetDefp result= (oaInterPointerAppDef_oaBusNetDef::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaBusNetDef_FromoaInterPointerAppDef_oaBusNetDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaBusNetDefp result= (oaInterPointerAppDef_oaBusNetDef::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaBusNetDef_FromoaInterPointerAppDef_oaBusNetDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaBusNetDefp result= (oaInterPointerAppDef_oaBusNetDef::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaBusNetDef_FromoaInterPointerAppDef_oaBusNetDef(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaBusNetDef, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaBusNetDef_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaBusNetDef_static_find,METH_VARARGS,oaInterPointerAppDef_oaBusNetDef_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaBusNetDef_static_get,METH_VARARGS,oaInterPointerAppDef_oaBusNetDef_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaBusNetDef_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaBusNetDef_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaBusNetDef\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaBusNetDef",
(PyObject*)(&PyoaInterPointerAppDef_oaBusNetDef_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaBusNetDef\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaBusNetDef_Type.tp_dict;
for(method=oaInterPointerAppDef_oaBusNetDef_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaBusTermDef
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaBusTermDef_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaBusTermDef_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaBusTermDefObject* self = (PyoaInterPointerAppDef_oaBusTermDefObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaBusTermDef)
{
PyParamoaInterPointerAppDef_oaBusTermDef p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaBusTermDef_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaBusTermDef, Choices are:\n"
" (oaInterPointerAppDef_oaBusTermDef)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaBusTermDef_tp_dealloc(PyoaInterPointerAppDef_oaBusTermDefObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaBusTermDef_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaBusTermDef value;
int convert_status=PyoaInterPointerAppDef_oaBusTermDef_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[55];
sprintf(buffer,"<oaInterPointerAppDef_oaBusTermDef::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaBusTermDef_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaBusTermDef v1;
PyParamoaInterPointerAppDef_oaBusTermDef v2;
int convert_status1=PyoaInterPointerAppDef_oaBusTermDef_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaBusTermDef_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaBusTermDef_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaBusTermDef* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaBusTermDef_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaBusTermDef**) ((PyoaInterPointerAppDef_oaBusTermDefObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaBusTermDef Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaBusTermDef_FromoaInterPointerAppDef_oaBusTermDef(oaInterPointerAppDef_oaBusTermDef** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaBusTermDef* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaBusTermDef_Type.tp_alloc(&PyoaInterPointerAppDef_oaBusTermDef_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaBusTermDefObject* self = (PyoaInterPointerAppDef_oaBusTermDefObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaBusTermDef_FromoaInterPointerAppDef_oaBusTermDef(oaInterPointerAppDef_oaBusTermDef* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaBusTermDef_Type.tp_alloc(&PyoaInterPointerAppDef_oaBusTermDef_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaBusTermDefObject* self = (PyoaInterPointerAppDef_oaBusTermDefObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBusTermDef_get_doc[] =
"Class: oaInterPointerAppDef_oaBusTermDef, Function: get\n"
" Paramegers: (oaBusTermDef)\n"
" Calls: oaObject* get(const oaBusTermDef* object)\n"
" Signature: get|ptr-oaObject|cptr-oaBusTermDef,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaBusTermDef_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaBusTermDef data;
int convert_status=PyoaInterPointerAppDef_oaBusTermDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaBusTermDefObject* self=(PyoaInterPointerAppDef_oaBusTermDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaBusTermDef p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaBusTermDef_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBusTermDef_set_doc[] =
"Class: oaInterPointerAppDef_oaBusTermDef, Function: set\n"
" Paramegers: (oaBusTermDef,oaObject)\n"
" Calls: void set(oaBusTermDef* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaBusTermDef,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaBusTermDef_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaBusTermDef data;
int convert_status=PyoaInterPointerAppDef_oaBusTermDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaBusTermDefObject* self=(PyoaInterPointerAppDef_oaBusTermDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaBusTermDef p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaBusTermDef_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBusTermDef_isNull_doc[] =
"Class: oaInterPointerAppDef_oaBusTermDef, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaBusTermDef_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaBusTermDef data;
int convert_status=PyoaInterPointerAppDef_oaBusTermDef_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaBusTermDef_assign_doc[] =
"Class: oaInterPointerAppDef_oaBusTermDef, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaBusTermDef_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaBusTermDef data;
int convert_status=PyoaInterPointerAppDef_oaBusTermDef_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaBusTermDef p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaBusTermDef_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaBusTermDef_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaBusTermDef_get,METH_VARARGS,oaInterPointerAppDef_oaBusTermDef_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaBusTermDef_set,METH_VARARGS,oaInterPointerAppDef_oaBusTermDef_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaBusTermDef_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaBusTermDef_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaBusTermDef_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaBusTermDef_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBusTermDef_doc[] =
"Class: oaInterPointerAppDef_oaBusTermDef\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaBusTermDef)\n"
" Calls: (const oaInterPointerAppDef_oaBusTermDef&)\n"
" Signature: oaInterPointerAppDef_oaBusTermDef||cref-oaInterPointerAppDef_oaBusTermDef,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaBusTermDef_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaBusTermDef",
sizeof(PyoaInterPointerAppDef_oaBusTermDefObject),
0,
(destructor)oaInterPointerAppDef_oaBusTermDef_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaBusTermDef_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaBusTermDef_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaBusTermDef_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaBusTermDef_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaBusTermDef_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBusTermDef_static_find_doc[] =
"Class: oaInterPointerAppDef_oaBusTermDef, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaBusTermDef* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaBusTermDef|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaBusTermDef* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaBusTermDef|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaBusTermDef_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaBusTermDefp result= (oaInterPointerAppDef_oaBusTermDef::find(p1.Data()));
return PyoaInterPointerAppDef_oaBusTermDef_FromoaInterPointerAppDef_oaBusTermDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaBusTermDefp result= (oaInterPointerAppDef_oaBusTermDef::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaBusTermDef_FromoaInterPointerAppDef_oaBusTermDef(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaBusTermDef, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaBusTermDef_static_get_doc[] =
"Class: oaInterPointerAppDef_oaBusTermDef, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaBusTermDef* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBusTermDef|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaBusTermDef* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBusTermDef|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaBusTermDef* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBusTermDef|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaBusTermDef* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaBusTermDef|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaBusTermDef_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaBusTermDefp result= (oaInterPointerAppDef_oaBusTermDef::get(p1.Data()));
return PyoaInterPointerAppDef_oaBusTermDef_FromoaInterPointerAppDef_oaBusTermDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaBusTermDefp result= (oaInterPointerAppDef_oaBusTermDef::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaBusTermDef_FromoaInterPointerAppDef_oaBusTermDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaBusTermDefp result= (oaInterPointerAppDef_oaBusTermDef::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaBusTermDef_FromoaInterPointerAppDef_oaBusTermDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaBusTermDefp result= (oaInterPointerAppDef_oaBusTermDef::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaBusTermDef_FromoaInterPointerAppDef_oaBusTermDef(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaBusTermDef, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaBusTermDef_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaBusTermDef_static_find,METH_VARARGS,oaInterPointerAppDef_oaBusTermDef_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaBusTermDef_static_get,METH_VARARGS,oaInterPointerAppDef_oaBusTermDef_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaBusTermDef_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaBusTermDef_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaBusTermDef\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaBusTermDef",
(PyObject*)(&PyoaInterPointerAppDef_oaBusTermDef_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaBusTermDef\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaBusTermDef_Type.tp_dict;
for(method=oaInterPointerAppDef_oaBusTermDef_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaCMap
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaCMap_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaCMap_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaCMapObject* self = (PyoaInterPointerAppDef_oaCMapObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaCMap)
{
PyParamoaInterPointerAppDef_oaCMap p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaCMap_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaCMap, Choices are:\n"
" (oaInterPointerAppDef_oaCMap)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaCMap_tp_dealloc(PyoaInterPointerAppDef_oaCMapObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaCMap_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaCMap value;
int convert_status=PyoaInterPointerAppDef_oaCMap_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[49];
sprintf(buffer,"<oaInterPointerAppDef_oaCMap::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaCMap_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaCMap v1;
PyParamoaInterPointerAppDef_oaCMap v2;
int convert_status1=PyoaInterPointerAppDef_oaCMap_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaCMap_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaCMap_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaCMap* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaCMap_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaCMap**) ((PyoaInterPointerAppDef_oaCMapObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaCMap Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaCMap_FromoaInterPointerAppDef_oaCMap(oaInterPointerAppDef_oaCMap** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaCMap* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaCMap_Type.tp_alloc(&PyoaInterPointerAppDef_oaCMap_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaCMapObject* self = (PyoaInterPointerAppDef_oaCMapObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaCMap_FromoaInterPointerAppDef_oaCMap(oaInterPointerAppDef_oaCMap* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaCMap_Type.tp_alloc(&PyoaInterPointerAppDef_oaCMap_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaCMapObject* self = (PyoaInterPointerAppDef_oaCMapObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCMap_get_doc[] =
"Class: oaInterPointerAppDef_oaCMap, Function: get\n"
" Paramegers: (oaCMap)\n"
" Calls: oaObject* get(const oaCMap* object)\n"
" Signature: get|ptr-oaObject|cptr-oaCMap,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaCMap_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaCMap data;
int convert_status=PyoaInterPointerAppDef_oaCMap_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaCMapObject* self=(PyoaInterPointerAppDef_oaCMapObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaCMap p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaCMap_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCMap_set_doc[] =
"Class: oaInterPointerAppDef_oaCMap, Function: set\n"
" Paramegers: (oaCMap,oaObject)\n"
" Calls: void set(oaCMap* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaCMap,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaCMap_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaCMap data;
int convert_status=PyoaInterPointerAppDef_oaCMap_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaCMapObject* self=(PyoaInterPointerAppDef_oaCMapObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaCMap p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaCMap_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCMap_isNull_doc[] =
"Class: oaInterPointerAppDef_oaCMap, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaCMap_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaCMap data;
int convert_status=PyoaInterPointerAppDef_oaCMap_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaCMap_assign_doc[] =
"Class: oaInterPointerAppDef_oaCMap, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaCMap_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaCMap data;
int convert_status=PyoaInterPointerAppDef_oaCMap_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaCMap p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaCMap_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaCMap_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaCMap_get,METH_VARARGS,oaInterPointerAppDef_oaCMap_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaCMap_set,METH_VARARGS,oaInterPointerAppDef_oaCMap_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaCMap_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaCMap_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaCMap_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaCMap_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCMap_doc[] =
"Class: oaInterPointerAppDef_oaCMap\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaCMap)\n"
" Calls: (const oaInterPointerAppDef_oaCMap&)\n"
" Signature: oaInterPointerAppDef_oaCMap||cref-oaInterPointerAppDef_oaCMap,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaCMap_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaCMap",
sizeof(PyoaInterPointerAppDef_oaCMapObject),
0,
(destructor)oaInterPointerAppDef_oaCMap_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaCMap_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaCMap_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaCMap_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaCMap_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaCMap_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCMap_static_find_doc[] =
"Class: oaInterPointerAppDef_oaCMap, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaCMap* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaCMap|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaCMap* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaCMap|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaCMap_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaCMapp result= (oaInterPointerAppDef_oaCMap::find(p1.Data()));
return PyoaInterPointerAppDef_oaCMap_FromoaInterPointerAppDef_oaCMap(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaCMapp result= (oaInterPointerAppDef_oaCMap::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaCMap_FromoaInterPointerAppDef_oaCMap(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaCMap, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCMap_static_get_doc[] =
"Class: oaInterPointerAppDef_oaCMap, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaCMap* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCMap|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaCMap* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCMap|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaCMap* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCMap|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaCMap* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCMap|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaCMap_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaCMapp result= (oaInterPointerAppDef_oaCMap::get(p1.Data()));
return PyoaInterPointerAppDef_oaCMap_FromoaInterPointerAppDef_oaCMap(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaCMapp result= (oaInterPointerAppDef_oaCMap::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaCMap_FromoaInterPointerAppDef_oaCMap(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaCMapp result= (oaInterPointerAppDef_oaCMap::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaCMap_FromoaInterPointerAppDef_oaCMap(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaCMapp result= (oaInterPointerAppDef_oaCMap::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaCMap_FromoaInterPointerAppDef_oaCMap(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaCMap, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaCMap_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaCMap_static_find,METH_VARARGS,oaInterPointerAppDef_oaCMap_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaCMap_static_get,METH_VARARGS,oaInterPointerAppDef_oaCMap_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaCMap_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaCMap_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaCMap\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaCMap",
(PyObject*)(&PyoaInterPointerAppDef_oaCMap_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaCMap\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaCMap_Type.tp_dict;
for(method=oaInterPointerAppDef_oaCMap_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaCell
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaCell_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaCell_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaCellObject* self = (PyoaInterPointerAppDef_oaCellObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaCell)
{
PyParamoaInterPointerAppDef_oaCell p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaCell_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaCell, Choices are:\n"
" (oaInterPointerAppDef_oaCell)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaCell_tp_dealloc(PyoaInterPointerAppDef_oaCellObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaCell_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaCell value;
int convert_status=PyoaInterPointerAppDef_oaCell_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[49];
sprintf(buffer,"<oaInterPointerAppDef_oaCell::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaCell_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaCell v1;
PyParamoaInterPointerAppDef_oaCell v2;
int convert_status1=PyoaInterPointerAppDef_oaCell_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaCell_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaCell_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaCell* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaCell_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaCell**) ((PyoaInterPointerAppDef_oaCellObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaCell Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaCell_FromoaInterPointerAppDef_oaCell(oaInterPointerAppDef_oaCell** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaCell* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaCell_Type.tp_alloc(&PyoaInterPointerAppDef_oaCell_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaCellObject* self = (PyoaInterPointerAppDef_oaCellObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaCell_FromoaInterPointerAppDef_oaCell(oaInterPointerAppDef_oaCell* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaCell_Type.tp_alloc(&PyoaInterPointerAppDef_oaCell_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaCellObject* self = (PyoaInterPointerAppDef_oaCellObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCell_get_doc[] =
"Class: oaInterPointerAppDef_oaCell, Function: get\n"
" Paramegers: (oaCell)\n"
" Calls: oaObject* get(const oaCell* object)\n"
" Signature: get|ptr-oaObject|cptr-oaCell,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaCell_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaCell data;
int convert_status=PyoaInterPointerAppDef_oaCell_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaCellObject* self=(PyoaInterPointerAppDef_oaCellObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaCell p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaCell_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCell_set_doc[] =
"Class: oaInterPointerAppDef_oaCell, Function: set\n"
" Paramegers: (oaCell,oaObject)\n"
" Calls: void set(oaCell* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaCell,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaCell_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaCell data;
int convert_status=PyoaInterPointerAppDef_oaCell_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaCellObject* self=(PyoaInterPointerAppDef_oaCellObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaCell p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaCell_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCell_isNull_doc[] =
"Class: oaInterPointerAppDef_oaCell, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaCell_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaCell data;
int convert_status=PyoaInterPointerAppDef_oaCell_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaCell_assign_doc[] =
"Class: oaInterPointerAppDef_oaCell, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaCell_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaCell data;
int convert_status=PyoaInterPointerAppDef_oaCell_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaCell p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaCell_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaCell_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaCell_get,METH_VARARGS,oaInterPointerAppDef_oaCell_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaCell_set,METH_VARARGS,oaInterPointerAppDef_oaCell_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaCell_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaCell_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaCell_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaCell_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCell_doc[] =
"Class: oaInterPointerAppDef_oaCell\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaCell)\n"
" Calls: (const oaInterPointerAppDef_oaCell&)\n"
" Signature: oaInterPointerAppDef_oaCell||cref-oaInterPointerAppDef_oaCell,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaCell_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaCell",
sizeof(PyoaInterPointerAppDef_oaCellObject),
0,
(destructor)oaInterPointerAppDef_oaCell_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaCell_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaCell_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaCell_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaCell_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaCell_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCell_static_find_doc[] =
"Class: oaInterPointerAppDef_oaCell, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaCell* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaCell|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaCell* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaCell|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaCell_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaCellp result= (oaInterPointerAppDef_oaCell::find(p1.Data()));
return PyoaInterPointerAppDef_oaCell_FromoaInterPointerAppDef_oaCell(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaCellp result= (oaInterPointerAppDef_oaCell::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaCell_FromoaInterPointerAppDef_oaCell(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaCell, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCell_static_get_doc[] =
"Class: oaInterPointerAppDef_oaCell, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaCell* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCell|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaCell* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCell|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaCell* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCell|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaCell* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCell|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaCell_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaCellp result= (oaInterPointerAppDef_oaCell::get(p1.Data()));
return PyoaInterPointerAppDef_oaCell_FromoaInterPointerAppDef_oaCell(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaCellp result= (oaInterPointerAppDef_oaCell::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaCell_FromoaInterPointerAppDef_oaCell(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaCellp result= (oaInterPointerAppDef_oaCell::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaCell_FromoaInterPointerAppDef_oaCell(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaCellp result= (oaInterPointerAppDef_oaCell::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaCell_FromoaInterPointerAppDef_oaCell(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaCell, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaCell_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaCell_static_find,METH_VARARGS,oaInterPointerAppDef_oaCell_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaCell_static_get,METH_VARARGS,oaInterPointerAppDef_oaCell_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaCell_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaCell_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaCell\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaCell",
(PyObject*)(&PyoaInterPointerAppDef_oaCell_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaCell\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaCell_Type.tp_dict;
for(method=oaInterPointerAppDef_oaCell_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaCellView
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaCellView_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaCellView_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaCellViewObject* self = (PyoaInterPointerAppDef_oaCellViewObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaCellView)
{
PyParamoaInterPointerAppDef_oaCellView p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaCellView_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaCellView, Choices are:\n"
" (oaInterPointerAppDef_oaCellView)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaCellView_tp_dealloc(PyoaInterPointerAppDef_oaCellViewObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaCellView_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaCellView value;
int convert_status=PyoaInterPointerAppDef_oaCellView_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[53];
sprintf(buffer,"<oaInterPointerAppDef_oaCellView::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaCellView_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaCellView v1;
PyParamoaInterPointerAppDef_oaCellView v2;
int convert_status1=PyoaInterPointerAppDef_oaCellView_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaCellView_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaCellView_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaCellView* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaCellView_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaCellView**) ((PyoaInterPointerAppDef_oaCellViewObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaCellView Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaCellView_FromoaInterPointerAppDef_oaCellView(oaInterPointerAppDef_oaCellView** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaCellView* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaCellView_Type.tp_alloc(&PyoaInterPointerAppDef_oaCellView_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaCellViewObject* self = (PyoaInterPointerAppDef_oaCellViewObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaCellView_FromoaInterPointerAppDef_oaCellView(oaInterPointerAppDef_oaCellView* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaCellView_Type.tp_alloc(&PyoaInterPointerAppDef_oaCellView_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaCellViewObject* self = (PyoaInterPointerAppDef_oaCellViewObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCellView_get_doc[] =
"Class: oaInterPointerAppDef_oaCellView, Function: get\n"
" Paramegers: (oaCellView)\n"
" Calls: oaObject* get(const oaCellView* object)\n"
" Signature: get|ptr-oaObject|cptr-oaCellView,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaCellView_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaCellView data;
int convert_status=PyoaInterPointerAppDef_oaCellView_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaCellViewObject* self=(PyoaInterPointerAppDef_oaCellViewObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaCellView p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaCellView_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCellView_set_doc[] =
"Class: oaInterPointerAppDef_oaCellView, Function: set\n"
" Paramegers: (oaCellView,oaObject)\n"
" Calls: void set(oaCellView* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaCellView,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaCellView_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaCellView data;
int convert_status=PyoaInterPointerAppDef_oaCellView_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaCellViewObject* self=(PyoaInterPointerAppDef_oaCellViewObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaCellView p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaCellView_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCellView_isNull_doc[] =
"Class: oaInterPointerAppDef_oaCellView, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaCellView_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaCellView data;
int convert_status=PyoaInterPointerAppDef_oaCellView_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaCellView_assign_doc[] =
"Class: oaInterPointerAppDef_oaCellView, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaCellView_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaCellView data;
int convert_status=PyoaInterPointerAppDef_oaCellView_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaCellView p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaCellView_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaCellView_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaCellView_get,METH_VARARGS,oaInterPointerAppDef_oaCellView_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaCellView_set,METH_VARARGS,oaInterPointerAppDef_oaCellView_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaCellView_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaCellView_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaCellView_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaCellView_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCellView_doc[] =
"Class: oaInterPointerAppDef_oaCellView\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaCellView)\n"
" Calls: (const oaInterPointerAppDef_oaCellView&)\n"
" Signature: oaInterPointerAppDef_oaCellView||cref-oaInterPointerAppDef_oaCellView,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaCellView_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaCellView",
sizeof(PyoaInterPointerAppDef_oaCellViewObject),
0,
(destructor)oaInterPointerAppDef_oaCellView_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaCellView_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaCellView_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaCellView_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaCellView_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaCellView_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCellView_static_find_doc[] =
"Class: oaInterPointerAppDef_oaCellView, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaCellView* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaCellView|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaCellView* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaCellView|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaCellView_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaCellViewp result= (oaInterPointerAppDef_oaCellView::find(p1.Data()));
return PyoaInterPointerAppDef_oaCellView_FromoaInterPointerAppDef_oaCellView(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaCellViewp result= (oaInterPointerAppDef_oaCellView::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaCellView_FromoaInterPointerAppDef_oaCellView(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaCellView, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCellView_static_get_doc[] =
"Class: oaInterPointerAppDef_oaCellView, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaCellView* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCellView|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaCellView* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCellView|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaCellView* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCellView|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaCellView* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCellView|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaCellView_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaCellViewp result= (oaInterPointerAppDef_oaCellView::get(p1.Data()));
return PyoaInterPointerAppDef_oaCellView_FromoaInterPointerAppDef_oaCellView(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaCellViewp result= (oaInterPointerAppDef_oaCellView::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaCellView_FromoaInterPointerAppDef_oaCellView(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaCellViewp result= (oaInterPointerAppDef_oaCellView::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaCellView_FromoaInterPointerAppDef_oaCellView(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaCellViewp result= (oaInterPointerAppDef_oaCellView::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaCellView_FromoaInterPointerAppDef_oaCellView(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaCellView, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaCellView_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaCellView_static_find,METH_VARARGS,oaInterPointerAppDef_oaCellView_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaCellView_static_get,METH_VARARGS,oaInterPointerAppDef_oaCellView_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaCellView_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaCellView_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaCellView\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaCellView",
(PyObject*)(&PyoaInterPointerAppDef_oaCellView_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaCellView\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaCellView_Type.tp_dict;
for(method=oaInterPointerAppDef_oaCellView_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaCluster
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaCluster_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaCluster_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaClusterObject* self = (PyoaInterPointerAppDef_oaClusterObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaCluster)
{
PyParamoaInterPointerAppDef_oaCluster p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaCluster_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaCluster, Choices are:\n"
" (oaInterPointerAppDef_oaCluster)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaCluster_tp_dealloc(PyoaInterPointerAppDef_oaClusterObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaCluster_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaCluster value;
int convert_status=PyoaInterPointerAppDef_oaCluster_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[52];
sprintf(buffer,"<oaInterPointerAppDef_oaCluster::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaCluster_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaCluster v1;
PyParamoaInterPointerAppDef_oaCluster v2;
int convert_status1=PyoaInterPointerAppDef_oaCluster_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaCluster_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaCluster_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaCluster* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaCluster_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaCluster**) ((PyoaInterPointerAppDef_oaClusterObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaCluster Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaCluster_FromoaInterPointerAppDef_oaCluster(oaInterPointerAppDef_oaCluster** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaCluster* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaCluster_Type.tp_alloc(&PyoaInterPointerAppDef_oaCluster_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaClusterObject* self = (PyoaInterPointerAppDef_oaClusterObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaCluster_FromoaInterPointerAppDef_oaCluster(oaInterPointerAppDef_oaCluster* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaCluster_Type.tp_alloc(&PyoaInterPointerAppDef_oaCluster_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaClusterObject* self = (PyoaInterPointerAppDef_oaClusterObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCluster_get_doc[] =
"Class: oaInterPointerAppDef_oaCluster, Function: get\n"
" Paramegers: (oaCluster)\n"
" Calls: oaObject* get(const oaCluster* object)\n"
" Signature: get|ptr-oaObject|cptr-oaCluster,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaCluster_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaCluster data;
int convert_status=PyoaInterPointerAppDef_oaCluster_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaClusterObject* self=(PyoaInterPointerAppDef_oaClusterObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaCluster p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaCluster_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCluster_set_doc[] =
"Class: oaInterPointerAppDef_oaCluster, Function: set\n"
" Paramegers: (oaCluster,oaObject)\n"
" Calls: void set(oaCluster* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaCluster,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaCluster_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaCluster data;
int convert_status=PyoaInterPointerAppDef_oaCluster_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaClusterObject* self=(PyoaInterPointerAppDef_oaClusterObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaCluster p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaCluster_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCluster_isNull_doc[] =
"Class: oaInterPointerAppDef_oaCluster, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaCluster_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaCluster data;
int convert_status=PyoaInterPointerAppDef_oaCluster_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaCluster_assign_doc[] =
"Class: oaInterPointerAppDef_oaCluster, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaCluster_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaCluster data;
int convert_status=PyoaInterPointerAppDef_oaCluster_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaCluster p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaCluster_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaCluster_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaCluster_get,METH_VARARGS,oaInterPointerAppDef_oaCluster_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaCluster_set,METH_VARARGS,oaInterPointerAppDef_oaCluster_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaCluster_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaCluster_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaCluster_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaCluster_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCluster_doc[] =
"Class: oaInterPointerAppDef_oaCluster\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaCluster)\n"
" Calls: (const oaInterPointerAppDef_oaCluster&)\n"
" Signature: oaInterPointerAppDef_oaCluster||cref-oaInterPointerAppDef_oaCluster,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaCluster_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaCluster",
sizeof(PyoaInterPointerAppDef_oaClusterObject),
0,
(destructor)oaInterPointerAppDef_oaCluster_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaCluster_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaCluster_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaCluster_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaCluster_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaCluster_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCluster_static_find_doc[] =
"Class: oaInterPointerAppDef_oaCluster, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaCluster* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaCluster|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaCluster* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaCluster|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaCluster_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaClusterp result= (oaInterPointerAppDef_oaCluster::find(p1.Data()));
return PyoaInterPointerAppDef_oaCluster_FromoaInterPointerAppDef_oaCluster(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaClusterp result= (oaInterPointerAppDef_oaCluster::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaCluster_FromoaInterPointerAppDef_oaCluster(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaCluster, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaCluster_static_get_doc[] =
"Class: oaInterPointerAppDef_oaCluster, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaCluster* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCluster|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaCluster* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCluster|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaCluster* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCluster|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaCluster* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaCluster|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaCluster_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaClusterp result= (oaInterPointerAppDef_oaCluster::get(p1.Data()));
return PyoaInterPointerAppDef_oaCluster_FromoaInterPointerAppDef_oaCluster(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaClusterp result= (oaInterPointerAppDef_oaCluster::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaCluster_FromoaInterPointerAppDef_oaCluster(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaClusterp result= (oaInterPointerAppDef_oaCluster::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaCluster_FromoaInterPointerAppDef_oaCluster(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaClusterp result= (oaInterPointerAppDef_oaCluster::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaCluster_FromoaInterPointerAppDef_oaCluster(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaCluster, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaCluster_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaCluster_static_find,METH_VARARGS,oaInterPointerAppDef_oaCluster_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaCluster_static_get,METH_VARARGS,oaInterPointerAppDef_oaCluster_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaCluster_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaCluster_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaCluster\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaCluster",
(PyObject*)(&PyoaInterPointerAppDef_oaCluster_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaCluster\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaCluster_Type.tp_dict;
for(method=oaInterPointerAppDef_oaCluster_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaConnectDef
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConnectDef_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaConnectDef_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConnectDefObject* self = (PyoaInterPointerAppDef_oaConnectDefObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaConnectDef)
{
PyParamoaInterPointerAppDef_oaConnectDef p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConnectDef_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaConnectDef, Choices are:\n"
" (oaInterPointerAppDef_oaConnectDef)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaConnectDef_tp_dealloc(PyoaInterPointerAppDef_oaConnectDefObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConnectDef_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaConnectDef value;
int convert_status=PyoaInterPointerAppDef_oaConnectDef_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[55];
sprintf(buffer,"<oaInterPointerAppDef_oaConnectDef::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaConnectDef_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaConnectDef v1;
PyParamoaInterPointerAppDef_oaConnectDef v2;
int convert_status1=PyoaInterPointerAppDef_oaConnectDef_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaConnectDef_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConnectDef_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaConnectDef* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaConnectDef_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaConnectDef**) ((PyoaInterPointerAppDef_oaConnectDefObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaConnectDef Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConnectDef_FromoaInterPointerAppDef_oaConnectDef(oaInterPointerAppDef_oaConnectDef** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaConnectDef* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaConnectDef_Type.tp_alloc(&PyoaInterPointerAppDef_oaConnectDef_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConnectDefObject* self = (PyoaInterPointerAppDef_oaConnectDefObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConnectDef_FromoaInterPointerAppDef_oaConnectDef(oaInterPointerAppDef_oaConnectDef* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaConnectDef_Type.tp_alloc(&PyoaInterPointerAppDef_oaConnectDef_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConnectDefObject* self = (PyoaInterPointerAppDef_oaConnectDefObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConnectDef_get_doc[] =
"Class: oaInterPointerAppDef_oaConnectDef, Function: get\n"
" Paramegers: (oaConnectDef)\n"
" Calls: oaObject* get(const oaConnectDef* object)\n"
" Signature: get|ptr-oaObject|cptr-oaConnectDef,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConnectDef_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConnectDef data;
int convert_status=PyoaInterPointerAppDef_oaConnectDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConnectDefObject* self=(PyoaInterPointerAppDef_oaConnectDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConnectDef p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaConnectDef_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConnectDef_set_doc[] =
"Class: oaInterPointerAppDef_oaConnectDef, Function: set\n"
" Paramegers: (oaConnectDef,oaObject)\n"
" Calls: void set(oaConnectDef* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaConnectDef,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConnectDef_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConnectDef data;
int convert_status=PyoaInterPointerAppDef_oaConnectDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConnectDefObject* self=(PyoaInterPointerAppDef_oaConnectDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConnectDef p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaConnectDef_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConnectDef_isNull_doc[] =
"Class: oaInterPointerAppDef_oaConnectDef, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaConnectDef_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConnectDef data;
int convert_status=PyoaInterPointerAppDef_oaConnectDef_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaConnectDef_assign_doc[] =
"Class: oaInterPointerAppDef_oaConnectDef, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaConnectDef_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConnectDef data;
int convert_status=PyoaInterPointerAppDef_oaConnectDef_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaConnectDef p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConnectDef_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConnectDef_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaConnectDef_get,METH_VARARGS,oaInterPointerAppDef_oaConnectDef_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaConnectDef_set,METH_VARARGS,oaInterPointerAppDef_oaConnectDef_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaConnectDef_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaConnectDef_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaConnectDef_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaConnectDef_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConnectDef_doc[] =
"Class: oaInterPointerAppDef_oaConnectDef\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaConnectDef)\n"
" Calls: (const oaInterPointerAppDef_oaConnectDef&)\n"
" Signature: oaInterPointerAppDef_oaConnectDef||cref-oaInterPointerAppDef_oaConnectDef,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaConnectDef_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaConnectDef",
sizeof(PyoaInterPointerAppDef_oaConnectDefObject),
0,
(destructor)oaInterPointerAppDef_oaConnectDef_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaConnectDef_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaConnectDef_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaConnectDef_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaConnectDef_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaConnectDef_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConnectDef_static_find_doc[] =
"Class: oaInterPointerAppDef_oaConnectDef, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConnectDef* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConnectDef|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConnectDef* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConnectDef|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaConnectDef_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConnectDefp result= (oaInterPointerAppDef_oaConnectDef::find(p1.Data()));
return PyoaInterPointerAppDef_oaConnectDef_FromoaInterPointerAppDef_oaConnectDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConnectDefp result= (oaInterPointerAppDef_oaConnectDef::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConnectDef_FromoaInterPointerAppDef_oaConnectDef(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConnectDef, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConnectDef_static_get_doc[] =
"Class: oaInterPointerAppDef_oaConnectDef, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConnectDef* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConnectDef|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConnectDef* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConnectDef|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConnectDef* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConnectDef|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConnectDef* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConnectDef|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaConnectDef_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConnectDefp result= (oaInterPointerAppDef_oaConnectDef::get(p1.Data()));
return PyoaInterPointerAppDef_oaConnectDef_FromoaInterPointerAppDef_oaConnectDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaConnectDefp result= (oaInterPointerAppDef_oaConnectDef::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConnectDef_FromoaInterPointerAppDef_oaConnectDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConnectDefp result= (oaInterPointerAppDef_oaConnectDef::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConnectDef_FromoaInterPointerAppDef_oaConnectDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConnectDefp result= (oaInterPointerAppDef_oaConnectDef::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaConnectDef_FromoaInterPointerAppDef_oaConnectDef(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConnectDef, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConnectDef_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaConnectDef_static_find,METH_VARARGS,oaInterPointerAppDef_oaConnectDef_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaConnectDef_static_get,METH_VARARGS,oaInterPointerAppDef_oaConnectDef_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConnectDef_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaConnectDef_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaConnectDef\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaConnectDef",
(PyObject*)(&PyoaInterPointerAppDef_oaConnectDef_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaConnectDef\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaConnectDef_Type.tp_dict;
for(method=oaInterPointerAppDef_oaConnectDef_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaConstraint
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConstraint_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaConstraint_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintObject* self = (PyoaInterPointerAppDef_oaConstraintObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaConstraint)
{
PyParamoaInterPointerAppDef_oaConstraint p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConstraint_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaConstraint, Choices are:\n"
" (oaInterPointerAppDef_oaConstraint)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaConstraint_tp_dealloc(PyoaInterPointerAppDef_oaConstraintObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConstraint_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaConstraint value;
int convert_status=PyoaInterPointerAppDef_oaConstraint_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[55];
sprintf(buffer,"<oaInterPointerAppDef_oaConstraint::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaConstraint_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaConstraint v1;
PyParamoaInterPointerAppDef_oaConstraint v2;
int convert_status1=PyoaInterPointerAppDef_oaConstraint_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaConstraint_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConstraint_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaConstraint* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaConstraint_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaConstraint**) ((PyoaInterPointerAppDef_oaConstraintObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaConstraint Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConstraint_FromoaInterPointerAppDef_oaConstraint(oaInterPointerAppDef_oaConstraint** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaConstraint* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaConstraint_Type.tp_alloc(&PyoaInterPointerAppDef_oaConstraint_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintObject* self = (PyoaInterPointerAppDef_oaConstraintObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConstraint_FromoaInterPointerAppDef_oaConstraint(oaInterPointerAppDef_oaConstraint* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaConstraint_Type.tp_alloc(&PyoaInterPointerAppDef_oaConstraint_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintObject* self = (PyoaInterPointerAppDef_oaConstraintObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraint_get_doc[] =
"Class: oaInterPointerAppDef_oaConstraint, Function: get\n"
" Paramegers: (oaConstraint)\n"
" Calls: oaObject* get(const oaConstraint* object)\n"
" Signature: get|ptr-oaObject|cptr-oaConstraint,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraint_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConstraint data;
int convert_status=PyoaInterPointerAppDef_oaConstraint_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConstraintObject* self=(PyoaInterPointerAppDef_oaConstraintObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConstraint p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaConstraint_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraint_set_doc[] =
"Class: oaInterPointerAppDef_oaConstraint, Function: set\n"
" Paramegers: (oaConstraint,oaObject)\n"
" Calls: void set(oaConstraint* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaConstraint,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraint_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConstraint data;
int convert_status=PyoaInterPointerAppDef_oaConstraint_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConstraintObject* self=(PyoaInterPointerAppDef_oaConstraintObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConstraint p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaConstraint_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraint_isNull_doc[] =
"Class: oaInterPointerAppDef_oaConstraint, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraint_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConstraint data;
int convert_status=PyoaInterPointerAppDef_oaConstraint_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaConstraint_assign_doc[] =
"Class: oaInterPointerAppDef_oaConstraint, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraint_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConstraint data;
int convert_status=PyoaInterPointerAppDef_oaConstraint_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaConstraint p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConstraint_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConstraint_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaConstraint_get,METH_VARARGS,oaInterPointerAppDef_oaConstraint_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaConstraint_set,METH_VARARGS,oaInterPointerAppDef_oaConstraint_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaConstraint_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaConstraint_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaConstraint_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaConstraint_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraint_doc[] =
"Class: oaInterPointerAppDef_oaConstraint\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaConstraint)\n"
" Calls: (const oaInterPointerAppDef_oaConstraint&)\n"
" Signature: oaInterPointerAppDef_oaConstraint||cref-oaInterPointerAppDef_oaConstraint,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaConstraint_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaConstraint",
sizeof(PyoaInterPointerAppDef_oaConstraintObject),
0,
(destructor)oaInterPointerAppDef_oaConstraint_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaConstraint_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaConstraint_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaConstraint_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaConstraint_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaConstraint_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraint_static_find_doc[] =
"Class: oaInterPointerAppDef_oaConstraint, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConstraint* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConstraint|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConstraint* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConstraint|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraint_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConstraintp result= (oaInterPointerAppDef_oaConstraint::find(p1.Data()));
return PyoaInterPointerAppDef_oaConstraint_FromoaInterPointerAppDef_oaConstraint(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintp result= (oaInterPointerAppDef_oaConstraint::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraint_FromoaInterPointerAppDef_oaConstraint(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConstraint, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraint_static_get_doc[] =
"Class: oaInterPointerAppDef_oaConstraint, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConstraint* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraint|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConstraint* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraint|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConstraint* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraint|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConstraint* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraint|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraint_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConstraintp result= (oaInterPointerAppDef_oaConstraint::get(p1.Data()));
return PyoaInterPointerAppDef_oaConstraint_FromoaInterPointerAppDef_oaConstraint(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaConstraintp result= (oaInterPointerAppDef_oaConstraint::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraint_FromoaInterPointerAppDef_oaConstraint(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintp result= (oaInterPointerAppDef_oaConstraint::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraint_FromoaInterPointerAppDef_oaConstraint(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintp result= (oaInterPointerAppDef_oaConstraint::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaConstraint_FromoaInterPointerAppDef_oaConstraint(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConstraint, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConstraint_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaConstraint_static_find,METH_VARARGS,oaInterPointerAppDef_oaConstraint_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaConstraint_static_get,METH_VARARGS,oaInterPointerAppDef_oaConstraint_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConstraint_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaConstraint_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaConstraint\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaConstraint",
(PyObject*)(&PyoaInterPointerAppDef_oaConstraint_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaConstraint\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaConstraint_Type.tp_dict;
for(method=oaInterPointerAppDef_oaConstraint_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaConstraintDef
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConstraintDef_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaConstraintDef_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintDefObject* self = (PyoaInterPointerAppDef_oaConstraintDefObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaConstraintDef)
{
PyParamoaInterPointerAppDef_oaConstraintDef p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConstraintDef_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaConstraintDef, Choices are:\n"
" (oaInterPointerAppDef_oaConstraintDef)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaConstraintDef_tp_dealloc(PyoaInterPointerAppDef_oaConstraintDefObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConstraintDef_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaConstraintDef value;
int convert_status=PyoaInterPointerAppDef_oaConstraintDef_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[58];
sprintf(buffer,"<oaInterPointerAppDef_oaConstraintDef::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaConstraintDef_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaConstraintDef v1;
PyParamoaInterPointerAppDef_oaConstraintDef v2;
int convert_status1=PyoaInterPointerAppDef_oaConstraintDef_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaConstraintDef_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConstraintDef_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaConstraintDef* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaConstraintDef_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaConstraintDef**) ((PyoaInterPointerAppDef_oaConstraintDefObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaConstraintDef Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConstraintDef_FromoaInterPointerAppDef_oaConstraintDef(oaInterPointerAppDef_oaConstraintDef** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaConstraintDef* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaConstraintDef_Type.tp_alloc(&PyoaInterPointerAppDef_oaConstraintDef_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintDefObject* self = (PyoaInterPointerAppDef_oaConstraintDefObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConstraintDef_FromoaInterPointerAppDef_oaConstraintDef(oaInterPointerAppDef_oaConstraintDef* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaConstraintDef_Type.tp_alloc(&PyoaInterPointerAppDef_oaConstraintDef_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintDefObject* self = (PyoaInterPointerAppDef_oaConstraintDefObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintDef_get_doc[] =
"Class: oaInterPointerAppDef_oaConstraintDef, Function: get\n"
" Paramegers: (oaConstraintDef)\n"
" Calls: oaObject* get(const oaConstraintDef* object)\n"
" Signature: get|ptr-oaObject|cptr-oaConstraintDef,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintDef_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConstraintDef data;
int convert_status=PyoaInterPointerAppDef_oaConstraintDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConstraintDefObject* self=(PyoaInterPointerAppDef_oaConstraintDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConstraintDef p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaConstraintDef_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintDef_set_doc[] =
"Class: oaInterPointerAppDef_oaConstraintDef, Function: set\n"
" Paramegers: (oaConstraintDef,oaObject)\n"
" Calls: void set(oaConstraintDef* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaConstraintDef,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintDef_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConstraintDef data;
int convert_status=PyoaInterPointerAppDef_oaConstraintDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConstraintDefObject* self=(PyoaInterPointerAppDef_oaConstraintDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConstraintDef p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaConstraintDef_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintDef_isNull_doc[] =
"Class: oaInterPointerAppDef_oaConstraintDef, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintDef_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConstraintDef data;
int convert_status=PyoaInterPointerAppDef_oaConstraintDef_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaConstraintDef_assign_doc[] =
"Class: oaInterPointerAppDef_oaConstraintDef, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintDef_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConstraintDef data;
int convert_status=PyoaInterPointerAppDef_oaConstraintDef_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaConstraintDef p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConstraintDef_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConstraintDef_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaConstraintDef_get,METH_VARARGS,oaInterPointerAppDef_oaConstraintDef_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaConstraintDef_set,METH_VARARGS,oaInterPointerAppDef_oaConstraintDef_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaConstraintDef_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaConstraintDef_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaConstraintDef_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaConstraintDef_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintDef_doc[] =
"Class: oaInterPointerAppDef_oaConstraintDef\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaConstraintDef)\n"
" Calls: (const oaInterPointerAppDef_oaConstraintDef&)\n"
" Signature: oaInterPointerAppDef_oaConstraintDef||cref-oaInterPointerAppDef_oaConstraintDef,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaConstraintDef_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaConstraintDef",
sizeof(PyoaInterPointerAppDef_oaConstraintDefObject),
0,
(destructor)oaInterPointerAppDef_oaConstraintDef_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaConstraintDef_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaConstraintDef_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaConstraintDef_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaConstraintDef_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaConstraintDef_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintDef_static_find_doc[] =
"Class: oaInterPointerAppDef_oaConstraintDef, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConstraintDef* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConstraintDef|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConstraintDef* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConstraintDef|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintDef_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConstraintDefp result= (oaInterPointerAppDef_oaConstraintDef::find(p1.Data()));
return PyoaInterPointerAppDef_oaConstraintDef_FromoaInterPointerAppDef_oaConstraintDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintDefp result= (oaInterPointerAppDef_oaConstraintDef::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintDef_FromoaInterPointerAppDef_oaConstraintDef(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConstraintDef, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintDef_static_get_doc[] =
"Class: oaInterPointerAppDef_oaConstraintDef, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConstraintDef* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintDef|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConstraintDef* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintDef|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConstraintDef* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintDef|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConstraintDef* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintDef|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintDef_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConstraintDefp result= (oaInterPointerAppDef_oaConstraintDef::get(p1.Data()));
return PyoaInterPointerAppDef_oaConstraintDef_FromoaInterPointerAppDef_oaConstraintDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaConstraintDefp result= (oaInterPointerAppDef_oaConstraintDef::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintDef_FromoaInterPointerAppDef_oaConstraintDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintDefp result= (oaInterPointerAppDef_oaConstraintDef::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintDef_FromoaInterPointerAppDef_oaConstraintDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintDefp result= (oaInterPointerAppDef_oaConstraintDef::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaConstraintDef_FromoaInterPointerAppDef_oaConstraintDef(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConstraintDef, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConstraintDef_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaConstraintDef_static_find,METH_VARARGS,oaInterPointerAppDef_oaConstraintDef_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaConstraintDef_static_get,METH_VARARGS,oaInterPointerAppDef_oaConstraintDef_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConstraintDef_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaConstraintDef_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaConstraintDef\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaConstraintDef",
(PyObject*)(&PyoaInterPointerAppDef_oaConstraintDef_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaConstraintDef\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaConstraintDef_Type.tp_dict;
for(method=oaInterPointerAppDef_oaConstraintDef_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaConstraintGroup
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConstraintGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaConstraintGroup_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintGroupObject* self = (PyoaInterPointerAppDef_oaConstraintGroupObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaConstraintGroup)
{
PyParamoaInterPointerAppDef_oaConstraintGroup p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConstraintGroup_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaConstraintGroup, Choices are:\n"
" (oaInterPointerAppDef_oaConstraintGroup)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaConstraintGroup_tp_dealloc(PyoaInterPointerAppDef_oaConstraintGroupObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConstraintGroup_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaConstraintGroup value;
int convert_status=PyoaInterPointerAppDef_oaConstraintGroup_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[60];
sprintf(buffer,"<oaInterPointerAppDef_oaConstraintGroup::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaConstraintGroup_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaConstraintGroup v1;
PyParamoaInterPointerAppDef_oaConstraintGroup v2;
int convert_status1=PyoaInterPointerAppDef_oaConstraintGroup_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaConstraintGroup_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConstraintGroup_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaConstraintGroup* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaConstraintGroup_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaConstraintGroup**) ((PyoaInterPointerAppDef_oaConstraintGroupObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaConstraintGroup Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConstraintGroup_FromoaInterPointerAppDef_oaConstraintGroup(oaInterPointerAppDef_oaConstraintGroup** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaConstraintGroup* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaConstraintGroup_Type.tp_alloc(&PyoaInterPointerAppDef_oaConstraintGroup_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintGroupObject* self = (PyoaInterPointerAppDef_oaConstraintGroupObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConstraintGroup_FromoaInterPointerAppDef_oaConstraintGroup(oaInterPointerAppDef_oaConstraintGroup* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaConstraintGroup_Type.tp_alloc(&PyoaInterPointerAppDef_oaConstraintGroup_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintGroupObject* self = (PyoaInterPointerAppDef_oaConstraintGroupObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroup_get_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroup, Function: get\n"
" Paramegers: (oaConstraintGroup)\n"
" Calls: oaObject* get(const oaConstraintGroup* object)\n"
" Signature: get|ptr-oaObject|cptr-oaConstraintGroup,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroup_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConstraintGroup data;
int convert_status=PyoaInterPointerAppDef_oaConstraintGroup_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConstraintGroupObject* self=(PyoaInterPointerAppDef_oaConstraintGroupObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConstraintGroup p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaConstraintGroup_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroup_set_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroup, Function: set\n"
" Paramegers: (oaConstraintGroup,oaObject)\n"
" Calls: void set(oaConstraintGroup* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaConstraintGroup,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroup_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConstraintGroup data;
int convert_status=PyoaInterPointerAppDef_oaConstraintGroup_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConstraintGroupObject* self=(PyoaInterPointerAppDef_oaConstraintGroupObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConstraintGroup p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaConstraintGroup_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroup_isNull_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroup, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroup_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConstraintGroup data;
int convert_status=PyoaInterPointerAppDef_oaConstraintGroup_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaConstraintGroup_assign_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroup, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroup_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConstraintGroup data;
int convert_status=PyoaInterPointerAppDef_oaConstraintGroup_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaConstraintGroup p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConstraintGroup_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConstraintGroup_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaConstraintGroup_get,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroup_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaConstraintGroup_set,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroup_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaConstraintGroup_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroup_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaConstraintGroup_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroup_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroup_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroup\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaConstraintGroup)\n"
" Calls: (const oaInterPointerAppDef_oaConstraintGroup&)\n"
" Signature: oaInterPointerAppDef_oaConstraintGroup||cref-oaInterPointerAppDef_oaConstraintGroup,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaConstraintGroup_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaConstraintGroup",
sizeof(PyoaInterPointerAppDef_oaConstraintGroupObject),
0,
(destructor)oaInterPointerAppDef_oaConstraintGroup_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaConstraintGroup_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaConstraintGroup_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaConstraintGroup_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaConstraintGroup_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaConstraintGroup_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroup_static_find_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroup, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroup* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConstraintGroup|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroup* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConstraintGroup|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroup_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConstraintGroupp result= (oaInterPointerAppDef_oaConstraintGroup::find(p1.Data()));
return PyoaInterPointerAppDef_oaConstraintGroup_FromoaInterPointerAppDef_oaConstraintGroup(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintGroupp result= (oaInterPointerAppDef_oaConstraintGroup::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintGroup_FromoaInterPointerAppDef_oaConstraintGroup(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConstraintGroup, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroup_static_get_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroup, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroup* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintGroup|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroup* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintGroup|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroup* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintGroup|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroup* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintGroup|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroup_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConstraintGroupp result= (oaInterPointerAppDef_oaConstraintGroup::get(p1.Data()));
return PyoaInterPointerAppDef_oaConstraintGroup_FromoaInterPointerAppDef_oaConstraintGroup(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaConstraintGroupp result= (oaInterPointerAppDef_oaConstraintGroup::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintGroup_FromoaInterPointerAppDef_oaConstraintGroup(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintGroupp result= (oaInterPointerAppDef_oaConstraintGroup::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintGroup_FromoaInterPointerAppDef_oaConstraintGroup(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintGroupp result= (oaInterPointerAppDef_oaConstraintGroup::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaConstraintGroup_FromoaInterPointerAppDef_oaConstraintGroup(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConstraintGroup, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConstraintGroup_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaConstraintGroup_static_find,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroup_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaConstraintGroup_static_get,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroup_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConstraintGroup_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaConstraintGroup_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaConstraintGroup\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaConstraintGroup",
(PyObject*)(&PyoaInterPointerAppDef_oaConstraintGroup_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaConstraintGroup\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaConstraintGroup_Type.tp_dict;
for(method=oaInterPointerAppDef_oaConstraintGroup_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaConstraintGroupHeader
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConstraintGroupHeader_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaConstraintGroupHeader_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintGroupHeaderObject* self = (PyoaInterPointerAppDef_oaConstraintGroupHeaderObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaConstraintGroupHeader)
{
PyParamoaInterPointerAppDef_oaConstraintGroupHeader p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConstraintGroupHeader_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaConstraintGroupHeader, Choices are:\n"
" (oaInterPointerAppDef_oaConstraintGroupHeader)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaConstraintGroupHeader_tp_dealloc(PyoaInterPointerAppDef_oaConstraintGroupHeaderObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConstraintGroupHeader_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaConstraintGroupHeader value;
int convert_status=PyoaInterPointerAppDef_oaConstraintGroupHeader_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[66];
sprintf(buffer,"<oaInterPointerAppDef_oaConstraintGroupHeader::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaConstraintGroupHeader_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaConstraintGroupHeader v1;
PyParamoaInterPointerAppDef_oaConstraintGroupHeader v2;
int convert_status1=PyoaInterPointerAppDef_oaConstraintGroupHeader_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaConstraintGroupHeader_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConstraintGroupHeader_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaConstraintGroupHeader* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaConstraintGroupHeader_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaConstraintGroupHeader**) ((PyoaInterPointerAppDef_oaConstraintGroupHeaderObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaConstraintGroupHeader Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConstraintGroupHeader_FromoaInterPointerAppDef_oaConstraintGroupHeader(oaInterPointerAppDef_oaConstraintGroupHeader** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaConstraintGroupHeader* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaConstraintGroupHeader_Type.tp_alloc(&PyoaInterPointerAppDef_oaConstraintGroupHeader_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintGroupHeaderObject* self = (PyoaInterPointerAppDef_oaConstraintGroupHeaderObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConstraintGroupHeader_FromoaInterPointerAppDef_oaConstraintGroupHeader(oaInterPointerAppDef_oaConstraintGroupHeader* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaConstraintGroupHeader_Type.tp_alloc(&PyoaInterPointerAppDef_oaConstraintGroupHeader_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintGroupHeaderObject* self = (PyoaInterPointerAppDef_oaConstraintGroupHeaderObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroupHeader_get_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroupHeader, Function: get\n"
" Paramegers: (oaConstraintGroupHeader)\n"
" Calls: oaObject* get(const oaConstraintGroupHeader* object)\n"
" Signature: get|ptr-oaObject|cptr-oaConstraintGroupHeader,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroupHeader_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConstraintGroupHeader data;
int convert_status=PyoaInterPointerAppDef_oaConstraintGroupHeader_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConstraintGroupHeaderObject* self=(PyoaInterPointerAppDef_oaConstraintGroupHeaderObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConstraintGroupHeader p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaConstraintGroupHeader_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroupHeader_set_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroupHeader, Function: set\n"
" Paramegers: (oaConstraintGroupHeader,oaObject)\n"
" Calls: void set(oaConstraintGroupHeader* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaConstraintGroupHeader,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroupHeader_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConstraintGroupHeader data;
int convert_status=PyoaInterPointerAppDef_oaConstraintGroupHeader_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConstraintGroupHeaderObject* self=(PyoaInterPointerAppDef_oaConstraintGroupHeaderObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConstraintGroupHeader p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaConstraintGroupHeader_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroupHeader_isNull_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroupHeader, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroupHeader_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConstraintGroupHeader data;
int convert_status=PyoaInterPointerAppDef_oaConstraintGroupHeader_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaConstraintGroupHeader_assign_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroupHeader, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroupHeader_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConstraintGroupHeader data;
int convert_status=PyoaInterPointerAppDef_oaConstraintGroupHeader_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaConstraintGroupHeader p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConstraintGroupHeader_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConstraintGroupHeader_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaConstraintGroupHeader_get,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroupHeader_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaConstraintGroupHeader_set,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroupHeader_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaConstraintGroupHeader_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroupHeader_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaConstraintGroupHeader_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroupHeader_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroupHeader_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroupHeader\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaConstraintGroupHeader)\n"
" Calls: (const oaInterPointerAppDef_oaConstraintGroupHeader&)\n"
" Signature: oaInterPointerAppDef_oaConstraintGroupHeader||cref-oaInterPointerAppDef_oaConstraintGroupHeader,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaConstraintGroupHeader_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaConstraintGroupHeader",
sizeof(PyoaInterPointerAppDef_oaConstraintGroupHeaderObject),
0,
(destructor)oaInterPointerAppDef_oaConstraintGroupHeader_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaConstraintGroupHeader_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaConstraintGroupHeader_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaConstraintGroupHeader_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaConstraintGroupHeader_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaConstraintGroupHeader_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroupHeader_static_find_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroupHeader, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroupHeader* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConstraintGroupHeader|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroupHeader* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConstraintGroupHeader|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroupHeader_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConstraintGroupHeaderp result= (oaInterPointerAppDef_oaConstraintGroupHeader::find(p1.Data()));
return PyoaInterPointerAppDef_oaConstraintGroupHeader_FromoaInterPointerAppDef_oaConstraintGroupHeader(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintGroupHeaderp result= (oaInterPointerAppDef_oaConstraintGroupHeader::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintGroupHeader_FromoaInterPointerAppDef_oaConstraintGroupHeader(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConstraintGroupHeader, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroupHeader_static_get_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroupHeader, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroupHeader* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintGroupHeader|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroupHeader* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintGroupHeader|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroupHeader* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintGroupHeader|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroupHeader* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintGroupHeader|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroupHeader_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConstraintGroupHeaderp result= (oaInterPointerAppDef_oaConstraintGroupHeader::get(p1.Data()));
return PyoaInterPointerAppDef_oaConstraintGroupHeader_FromoaInterPointerAppDef_oaConstraintGroupHeader(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaConstraintGroupHeaderp result= (oaInterPointerAppDef_oaConstraintGroupHeader::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintGroupHeader_FromoaInterPointerAppDef_oaConstraintGroupHeader(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintGroupHeaderp result= (oaInterPointerAppDef_oaConstraintGroupHeader::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintGroupHeader_FromoaInterPointerAppDef_oaConstraintGroupHeader(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintGroupHeaderp result= (oaInterPointerAppDef_oaConstraintGroupHeader::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaConstraintGroupHeader_FromoaInterPointerAppDef_oaConstraintGroupHeader(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConstraintGroupHeader, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConstraintGroupHeader_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaConstraintGroupHeader_static_find,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroupHeader_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaConstraintGroupHeader_static_get,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroupHeader_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConstraintGroupHeader_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaConstraintGroupHeader_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaConstraintGroupHeader\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaConstraintGroupHeader",
(PyObject*)(&PyoaInterPointerAppDef_oaConstraintGroupHeader_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaConstraintGroupHeader\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaConstraintGroupHeader_Type.tp_dict;
for(method=oaInterPointerAppDef_oaConstraintGroupHeader_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaConstraintGroupMem
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConstraintGroupMem_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaConstraintGroupMem_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintGroupMemObject* self = (PyoaInterPointerAppDef_oaConstraintGroupMemObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaConstraintGroupMem)
{
PyParamoaInterPointerAppDef_oaConstraintGroupMem p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConstraintGroupMem_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaConstraintGroupMem, Choices are:\n"
" (oaInterPointerAppDef_oaConstraintGroupMem)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaConstraintGroupMem_tp_dealloc(PyoaInterPointerAppDef_oaConstraintGroupMemObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConstraintGroupMem_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaConstraintGroupMem value;
int convert_status=PyoaInterPointerAppDef_oaConstraintGroupMem_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[63];
sprintf(buffer,"<oaInterPointerAppDef_oaConstraintGroupMem::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaConstraintGroupMem_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaConstraintGroupMem v1;
PyParamoaInterPointerAppDef_oaConstraintGroupMem v2;
int convert_status1=PyoaInterPointerAppDef_oaConstraintGroupMem_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaConstraintGroupMem_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConstraintGroupMem_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaConstraintGroupMem* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaConstraintGroupMem_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaConstraintGroupMem**) ((PyoaInterPointerAppDef_oaConstraintGroupMemObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaConstraintGroupMem Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConstraintGroupMem_FromoaInterPointerAppDef_oaConstraintGroupMem(oaInterPointerAppDef_oaConstraintGroupMem** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaConstraintGroupMem* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaConstraintGroupMem_Type.tp_alloc(&PyoaInterPointerAppDef_oaConstraintGroupMem_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintGroupMemObject* self = (PyoaInterPointerAppDef_oaConstraintGroupMemObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConstraintGroupMem_FromoaInterPointerAppDef_oaConstraintGroupMem(oaInterPointerAppDef_oaConstraintGroupMem* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaConstraintGroupMem_Type.tp_alloc(&PyoaInterPointerAppDef_oaConstraintGroupMem_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintGroupMemObject* self = (PyoaInterPointerAppDef_oaConstraintGroupMemObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroupMem_get_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroupMem, Function: get\n"
" Paramegers: (oaConstraintGroupMem)\n"
" Calls: oaObject* get(const oaConstraintGroupMem* object)\n"
" Signature: get|ptr-oaObject|cptr-oaConstraintGroupMem,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroupMem_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConstraintGroupMem data;
int convert_status=PyoaInterPointerAppDef_oaConstraintGroupMem_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConstraintGroupMemObject* self=(PyoaInterPointerAppDef_oaConstraintGroupMemObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConstraintGroupMem p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaConstraintGroupMem_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroupMem_set_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroupMem, Function: set\n"
" Paramegers: (oaConstraintGroupMem,oaObject)\n"
" Calls: void set(oaConstraintGroupMem* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaConstraintGroupMem,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroupMem_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConstraintGroupMem data;
int convert_status=PyoaInterPointerAppDef_oaConstraintGroupMem_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConstraintGroupMemObject* self=(PyoaInterPointerAppDef_oaConstraintGroupMemObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConstraintGroupMem p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaConstraintGroupMem_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroupMem_isNull_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroupMem, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroupMem_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConstraintGroupMem data;
int convert_status=PyoaInterPointerAppDef_oaConstraintGroupMem_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaConstraintGroupMem_assign_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroupMem, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroupMem_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConstraintGroupMem data;
int convert_status=PyoaInterPointerAppDef_oaConstraintGroupMem_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaConstraintGroupMem p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConstraintGroupMem_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConstraintGroupMem_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaConstraintGroupMem_get,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroupMem_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaConstraintGroupMem_set,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroupMem_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaConstraintGroupMem_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroupMem_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaConstraintGroupMem_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroupMem_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroupMem_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroupMem\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaConstraintGroupMem)\n"
" Calls: (const oaInterPointerAppDef_oaConstraintGroupMem&)\n"
" Signature: oaInterPointerAppDef_oaConstraintGroupMem||cref-oaInterPointerAppDef_oaConstraintGroupMem,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaConstraintGroupMem_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaConstraintGroupMem",
sizeof(PyoaInterPointerAppDef_oaConstraintGroupMemObject),
0,
(destructor)oaInterPointerAppDef_oaConstraintGroupMem_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaConstraintGroupMem_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaConstraintGroupMem_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaConstraintGroupMem_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaConstraintGroupMem_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaConstraintGroupMem_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroupMem_static_find_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroupMem, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroupMem* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConstraintGroupMem|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroupMem* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConstraintGroupMem|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroupMem_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConstraintGroupMemp result= (oaInterPointerAppDef_oaConstraintGroupMem::find(p1.Data()));
return PyoaInterPointerAppDef_oaConstraintGroupMem_FromoaInterPointerAppDef_oaConstraintGroupMem(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintGroupMemp result= (oaInterPointerAppDef_oaConstraintGroupMem::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintGroupMem_FromoaInterPointerAppDef_oaConstraintGroupMem(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConstraintGroupMem, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintGroupMem_static_get_doc[] =
"Class: oaInterPointerAppDef_oaConstraintGroupMem, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroupMem* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintGroupMem|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroupMem* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintGroupMem|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroupMem* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintGroupMem|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConstraintGroupMem* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintGroupMem|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintGroupMem_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConstraintGroupMemp result= (oaInterPointerAppDef_oaConstraintGroupMem::get(p1.Data()));
return PyoaInterPointerAppDef_oaConstraintGroupMem_FromoaInterPointerAppDef_oaConstraintGroupMem(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaConstraintGroupMemp result= (oaInterPointerAppDef_oaConstraintGroupMem::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintGroupMem_FromoaInterPointerAppDef_oaConstraintGroupMem(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintGroupMemp result= (oaInterPointerAppDef_oaConstraintGroupMem::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintGroupMem_FromoaInterPointerAppDef_oaConstraintGroupMem(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintGroupMemp result= (oaInterPointerAppDef_oaConstraintGroupMem::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaConstraintGroupMem_FromoaInterPointerAppDef_oaConstraintGroupMem(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConstraintGroupMem, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConstraintGroupMem_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaConstraintGroupMem_static_find,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroupMem_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaConstraintGroupMem_static_get,METH_VARARGS,oaInterPointerAppDef_oaConstraintGroupMem_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConstraintGroupMem_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaConstraintGroupMem_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaConstraintGroupMem\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaConstraintGroupMem",
(PyObject*)(&PyoaInterPointerAppDef_oaConstraintGroupMem_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaConstraintGroupMem\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaConstraintGroupMem_Type.tp_dict;
for(method=oaInterPointerAppDef_oaConstraintGroupMem_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaConstraintParam
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConstraintParam_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaConstraintParam_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintParamObject* self = (PyoaInterPointerAppDef_oaConstraintParamObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaConstraintParam)
{
PyParamoaInterPointerAppDef_oaConstraintParam p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConstraintParam_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaConstraintParam, Choices are:\n"
" (oaInterPointerAppDef_oaConstraintParam)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaConstraintParam_tp_dealloc(PyoaInterPointerAppDef_oaConstraintParamObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConstraintParam_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaConstraintParam value;
int convert_status=PyoaInterPointerAppDef_oaConstraintParam_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[60];
sprintf(buffer,"<oaInterPointerAppDef_oaConstraintParam::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaConstraintParam_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaConstraintParam v1;
PyParamoaInterPointerAppDef_oaConstraintParam v2;
int convert_status1=PyoaInterPointerAppDef_oaConstraintParam_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaConstraintParam_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConstraintParam_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaConstraintParam* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaConstraintParam_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaConstraintParam**) ((PyoaInterPointerAppDef_oaConstraintParamObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaConstraintParam Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConstraintParam_FromoaInterPointerAppDef_oaConstraintParam(oaInterPointerAppDef_oaConstraintParam** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaConstraintParam* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaConstraintParam_Type.tp_alloc(&PyoaInterPointerAppDef_oaConstraintParam_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintParamObject* self = (PyoaInterPointerAppDef_oaConstraintParamObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConstraintParam_FromoaInterPointerAppDef_oaConstraintParam(oaInterPointerAppDef_oaConstraintParam* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaConstraintParam_Type.tp_alloc(&PyoaInterPointerAppDef_oaConstraintParam_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintParamObject* self = (PyoaInterPointerAppDef_oaConstraintParamObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintParam_get_doc[] =
"Class: oaInterPointerAppDef_oaConstraintParam, Function: get\n"
" Paramegers: (oaConstraintParam)\n"
" Calls: oaObject* get(const oaConstraintParam* object)\n"
" Signature: get|ptr-oaObject|cptr-oaConstraintParam,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintParam_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConstraintParam data;
int convert_status=PyoaInterPointerAppDef_oaConstraintParam_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConstraintParamObject* self=(PyoaInterPointerAppDef_oaConstraintParamObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConstraintParam p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaConstraintParam_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintParam_set_doc[] =
"Class: oaInterPointerAppDef_oaConstraintParam, Function: set\n"
" Paramegers: (oaConstraintParam,oaObject)\n"
" Calls: void set(oaConstraintParam* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaConstraintParam,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintParam_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConstraintParam data;
int convert_status=PyoaInterPointerAppDef_oaConstraintParam_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConstraintParamObject* self=(PyoaInterPointerAppDef_oaConstraintParamObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConstraintParam p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaConstraintParam_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintParam_isNull_doc[] =
"Class: oaInterPointerAppDef_oaConstraintParam, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintParam_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConstraintParam data;
int convert_status=PyoaInterPointerAppDef_oaConstraintParam_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaConstraintParam_assign_doc[] =
"Class: oaInterPointerAppDef_oaConstraintParam, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintParam_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConstraintParam data;
int convert_status=PyoaInterPointerAppDef_oaConstraintParam_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaConstraintParam p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConstraintParam_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConstraintParam_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaConstraintParam_get,METH_VARARGS,oaInterPointerAppDef_oaConstraintParam_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaConstraintParam_set,METH_VARARGS,oaInterPointerAppDef_oaConstraintParam_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaConstraintParam_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaConstraintParam_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaConstraintParam_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaConstraintParam_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintParam_doc[] =
"Class: oaInterPointerAppDef_oaConstraintParam\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaConstraintParam)\n"
" Calls: (const oaInterPointerAppDef_oaConstraintParam&)\n"
" Signature: oaInterPointerAppDef_oaConstraintParam||cref-oaInterPointerAppDef_oaConstraintParam,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaConstraintParam_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaConstraintParam",
sizeof(PyoaInterPointerAppDef_oaConstraintParamObject),
0,
(destructor)oaInterPointerAppDef_oaConstraintParam_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaConstraintParam_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaConstraintParam_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaConstraintParam_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaConstraintParam_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaConstraintParam_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintParam_static_find_doc[] =
"Class: oaInterPointerAppDef_oaConstraintParam, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConstraintParam* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConstraintParam|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConstraintParam* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConstraintParam|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintParam_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConstraintParamp result= (oaInterPointerAppDef_oaConstraintParam::find(p1.Data()));
return PyoaInterPointerAppDef_oaConstraintParam_FromoaInterPointerAppDef_oaConstraintParam(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintParamp result= (oaInterPointerAppDef_oaConstraintParam::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintParam_FromoaInterPointerAppDef_oaConstraintParam(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConstraintParam, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintParam_static_get_doc[] =
"Class: oaInterPointerAppDef_oaConstraintParam, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConstraintParam* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintParam|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConstraintParam* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintParam|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConstraintParam* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintParam|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConstraintParam* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintParam|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintParam_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConstraintParamp result= (oaInterPointerAppDef_oaConstraintParam::get(p1.Data()));
return PyoaInterPointerAppDef_oaConstraintParam_FromoaInterPointerAppDef_oaConstraintParam(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaConstraintParamp result= (oaInterPointerAppDef_oaConstraintParam::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintParam_FromoaInterPointerAppDef_oaConstraintParam(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintParamp result= (oaInterPointerAppDef_oaConstraintParam::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintParam_FromoaInterPointerAppDef_oaConstraintParam(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintParamp result= (oaInterPointerAppDef_oaConstraintParam::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaConstraintParam_FromoaInterPointerAppDef_oaConstraintParam(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConstraintParam, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConstraintParam_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaConstraintParam_static_find,METH_VARARGS,oaInterPointerAppDef_oaConstraintParam_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaConstraintParam_static_get,METH_VARARGS,oaInterPointerAppDef_oaConstraintParam_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConstraintParam_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaConstraintParam_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaConstraintParam\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaConstraintParam",
(PyObject*)(&PyoaInterPointerAppDef_oaConstraintParam_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaConstraintParam\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaConstraintParam_Type.tp_dict;
for(method=oaInterPointerAppDef_oaConstraintParam_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaConstraintParamDef
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConstraintParamDef_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaConstraintParamDef_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintParamDefObject* self = (PyoaInterPointerAppDef_oaConstraintParamDefObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaConstraintParamDef)
{
PyParamoaInterPointerAppDef_oaConstraintParamDef p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConstraintParamDef_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaConstraintParamDef, Choices are:\n"
" (oaInterPointerAppDef_oaConstraintParamDef)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaConstraintParamDef_tp_dealloc(PyoaInterPointerAppDef_oaConstraintParamDefObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaConstraintParamDef_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaConstraintParamDef value;
int convert_status=PyoaInterPointerAppDef_oaConstraintParamDef_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[63];
sprintf(buffer,"<oaInterPointerAppDef_oaConstraintParamDef::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaConstraintParamDef_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaConstraintParamDef v1;
PyParamoaInterPointerAppDef_oaConstraintParamDef v2;
int convert_status1=PyoaInterPointerAppDef_oaConstraintParamDef_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaConstraintParamDef_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConstraintParamDef_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaConstraintParamDef* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaConstraintParamDef_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaConstraintParamDef**) ((PyoaInterPointerAppDef_oaConstraintParamDefObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaConstraintParamDef Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConstraintParamDef_FromoaInterPointerAppDef_oaConstraintParamDef(oaInterPointerAppDef_oaConstraintParamDef** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaConstraintParamDef* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaConstraintParamDef_Type.tp_alloc(&PyoaInterPointerAppDef_oaConstraintParamDef_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintParamDefObject* self = (PyoaInterPointerAppDef_oaConstraintParamDefObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaConstraintParamDef_FromoaInterPointerAppDef_oaConstraintParamDef(oaInterPointerAppDef_oaConstraintParamDef* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaConstraintParamDef_Type.tp_alloc(&PyoaInterPointerAppDef_oaConstraintParamDef_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaConstraintParamDefObject* self = (PyoaInterPointerAppDef_oaConstraintParamDefObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintParamDef_get_doc[] =
"Class: oaInterPointerAppDef_oaConstraintParamDef, Function: get\n"
" Paramegers: (oaConstraintParamDef)\n"
" Calls: oaObject* get(const oaConstraintParamDef* object)\n"
" Signature: get|ptr-oaObject|cptr-oaConstraintParamDef,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintParamDef_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConstraintParamDef data;
int convert_status=PyoaInterPointerAppDef_oaConstraintParamDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConstraintParamDefObject* self=(PyoaInterPointerAppDef_oaConstraintParamDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConstraintParamDef p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaConstraintParamDef_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintParamDef_set_doc[] =
"Class: oaInterPointerAppDef_oaConstraintParamDef, Function: set\n"
" Paramegers: (oaConstraintParamDef,oaObject)\n"
" Calls: void set(oaConstraintParamDef* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaConstraintParamDef,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintParamDef_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaConstraintParamDef data;
int convert_status=PyoaInterPointerAppDef_oaConstraintParamDef_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaConstraintParamDefObject* self=(PyoaInterPointerAppDef_oaConstraintParamDefObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaConstraintParamDef p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaConstraintParamDef_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintParamDef_isNull_doc[] =
"Class: oaInterPointerAppDef_oaConstraintParamDef, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintParamDef_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConstraintParamDef data;
int convert_status=PyoaInterPointerAppDef_oaConstraintParamDef_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaConstraintParamDef_assign_doc[] =
"Class: oaInterPointerAppDef_oaConstraintParamDef, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintParamDef_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaConstraintParamDef data;
int convert_status=PyoaInterPointerAppDef_oaConstraintParamDef_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaConstraintParamDef p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaConstraintParamDef_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConstraintParamDef_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaConstraintParamDef_get,METH_VARARGS,oaInterPointerAppDef_oaConstraintParamDef_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaConstraintParamDef_set,METH_VARARGS,oaInterPointerAppDef_oaConstraintParamDef_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaConstraintParamDef_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaConstraintParamDef_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaConstraintParamDef_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaConstraintParamDef_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintParamDef_doc[] =
"Class: oaInterPointerAppDef_oaConstraintParamDef\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaConstraintParamDef)\n"
" Calls: (const oaInterPointerAppDef_oaConstraintParamDef&)\n"
" Signature: oaInterPointerAppDef_oaConstraintParamDef||cref-oaInterPointerAppDef_oaConstraintParamDef,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaConstraintParamDef_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaConstraintParamDef",
sizeof(PyoaInterPointerAppDef_oaConstraintParamDefObject),
0,
(destructor)oaInterPointerAppDef_oaConstraintParamDef_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaConstraintParamDef_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaConstraintParamDef_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaConstraintParamDef_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaConstraintParamDef_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaConstraintParamDef_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintParamDef_static_find_doc[] =
"Class: oaInterPointerAppDef_oaConstraintParamDef, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConstraintParamDef* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConstraintParamDef|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConstraintParamDef* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaConstraintParamDef|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintParamDef_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConstraintParamDefp result= (oaInterPointerAppDef_oaConstraintParamDef::find(p1.Data()));
return PyoaInterPointerAppDef_oaConstraintParamDef_FromoaInterPointerAppDef_oaConstraintParamDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintParamDefp result= (oaInterPointerAppDef_oaConstraintParamDef::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintParamDef_FromoaInterPointerAppDef_oaConstraintParamDef(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConstraintParamDef, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaConstraintParamDef_static_get_doc[] =
"Class: oaInterPointerAppDef_oaConstraintParamDef, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaConstraintParamDef* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintParamDef|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConstraintParamDef* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintParamDef|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaConstraintParamDef* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintParamDef|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaConstraintParamDef* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaConstraintParamDef|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaConstraintParamDef_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaConstraintParamDefp result= (oaInterPointerAppDef_oaConstraintParamDef::get(p1.Data()));
return PyoaInterPointerAppDef_oaConstraintParamDef_FromoaInterPointerAppDef_oaConstraintParamDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaConstraintParamDefp result= (oaInterPointerAppDef_oaConstraintParamDef::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintParamDef_FromoaInterPointerAppDef_oaConstraintParamDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintParamDefp result= (oaInterPointerAppDef_oaConstraintParamDef::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaConstraintParamDef_FromoaInterPointerAppDef_oaConstraintParamDef(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaConstraintParamDefp result= (oaInterPointerAppDef_oaConstraintParamDef::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaConstraintParamDef_FromoaInterPointerAppDef_oaConstraintParamDef(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaConstraintParamDef, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaConstraintParamDef_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaConstraintParamDef_static_find,METH_VARARGS,oaInterPointerAppDef_oaConstraintParamDef_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaConstraintParamDef_static_get,METH_VARARGS,oaInterPointerAppDef_oaConstraintParamDef_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaConstraintParamDef_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaConstraintParamDef_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaConstraintParamDef\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaConstraintParamDef",
(PyObject*)(&PyoaInterPointerAppDef_oaConstraintParamDef_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaConstraintParamDef\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaConstraintParamDef_Type.tp_dict;
for(method=oaInterPointerAppDef_oaConstraintParamDef_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaDMData
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaDMData_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaDMData_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDMDataObject* self = (PyoaInterPointerAppDef_oaDMDataObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaDMData)
{
PyParamoaInterPointerAppDef_oaDMData p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaDMData_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaDMData, Choices are:\n"
" (oaInterPointerAppDef_oaDMData)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaDMData_tp_dealloc(PyoaInterPointerAppDef_oaDMDataObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaDMData_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaDMData value;
int convert_status=PyoaInterPointerAppDef_oaDMData_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[51];
sprintf(buffer,"<oaInterPointerAppDef_oaDMData::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaDMData_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaDMData v1;
PyParamoaInterPointerAppDef_oaDMData v2;
int convert_status1=PyoaInterPointerAppDef_oaDMData_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaDMData_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaDMData_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaDMData* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaDMData_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaDMData**) ((PyoaInterPointerAppDef_oaDMDataObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaDMData Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaDMData_FromoaInterPointerAppDef_oaDMData(oaInterPointerAppDef_oaDMData** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaDMData* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaDMData_Type.tp_alloc(&PyoaInterPointerAppDef_oaDMData_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDMDataObject* self = (PyoaInterPointerAppDef_oaDMDataObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaDMData_FromoaInterPointerAppDef_oaDMData(oaInterPointerAppDef_oaDMData* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaDMData_Type.tp_alloc(&PyoaInterPointerAppDef_oaDMData_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDMDataObject* self = (PyoaInterPointerAppDef_oaDMDataObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDMData_get_doc[] =
"Class: oaInterPointerAppDef_oaDMData, Function: get\n"
" Paramegers: (oaDMData)\n"
" Calls: oaObject* get(const oaDMData* object)\n"
" Signature: get|ptr-oaObject|cptr-oaDMData,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaDMData_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaDMData data;
int convert_status=PyoaInterPointerAppDef_oaDMData_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaDMDataObject* self=(PyoaInterPointerAppDef_oaDMDataObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaDMData p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaDMData_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDMData_set_doc[] =
"Class: oaInterPointerAppDef_oaDMData, Function: set\n"
" Paramegers: (oaDMData,oaObject)\n"
" Calls: void set(oaDMData* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaDMData,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaDMData_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaDMData data;
int convert_status=PyoaInterPointerAppDef_oaDMData_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaDMDataObject* self=(PyoaInterPointerAppDef_oaDMDataObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaDMData p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaDMData_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDMData_isNull_doc[] =
"Class: oaInterPointerAppDef_oaDMData, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaDMData_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaDMData data;
int convert_status=PyoaInterPointerAppDef_oaDMData_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaDMData_assign_doc[] =
"Class: oaInterPointerAppDef_oaDMData, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaDMData_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaDMData data;
int convert_status=PyoaInterPointerAppDef_oaDMData_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaDMData p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaDMData_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaDMData_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaDMData_get,METH_VARARGS,oaInterPointerAppDef_oaDMData_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaDMData_set,METH_VARARGS,oaInterPointerAppDef_oaDMData_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaDMData_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaDMData_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaDMData_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaDMData_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDMData_doc[] =
"Class: oaInterPointerAppDef_oaDMData\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaDMData)\n"
" Calls: (const oaInterPointerAppDef_oaDMData&)\n"
" Signature: oaInterPointerAppDef_oaDMData||cref-oaInterPointerAppDef_oaDMData,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaDMData_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaDMData",
sizeof(PyoaInterPointerAppDef_oaDMDataObject),
0,
(destructor)oaInterPointerAppDef_oaDMData_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaDMData_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaDMData_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaDMData_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaDMData_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaDMData_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDMData_static_find_doc[] =
"Class: oaInterPointerAppDef_oaDMData, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaDMData* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaDMData|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaDMData* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaDMData|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaDMData_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaDMDatap result= (oaInterPointerAppDef_oaDMData::find(p1.Data()));
return PyoaInterPointerAppDef_oaDMData_FromoaInterPointerAppDef_oaDMData(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDMDatap result= (oaInterPointerAppDef_oaDMData::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDMData_FromoaInterPointerAppDef_oaDMData(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaDMData, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDMData_static_get_doc[] =
"Class: oaInterPointerAppDef_oaDMData, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaDMData* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDMData|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaDMData* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDMData|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaDMData* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDMData|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaDMData* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDMData|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaDMData_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaDMDatap result= (oaInterPointerAppDef_oaDMData::get(p1.Data()));
return PyoaInterPointerAppDef_oaDMData_FromoaInterPointerAppDef_oaDMData(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaDMDatap result= (oaInterPointerAppDef_oaDMData::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDMData_FromoaInterPointerAppDef_oaDMData(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDMDatap result= (oaInterPointerAppDef_oaDMData::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDMData_FromoaInterPointerAppDef_oaDMData(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDMDatap result= (oaInterPointerAppDef_oaDMData::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaDMData_FromoaInterPointerAppDef_oaDMData(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaDMData, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaDMData_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaDMData_static_find,METH_VARARGS,oaInterPointerAppDef_oaDMData_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaDMData_static_get,METH_VARARGS,oaInterPointerAppDef_oaDMData_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaDMData_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaDMData_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaDMData\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaDMData",
(PyObject*)(&PyoaInterPointerAppDef_oaDMData_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaDMData\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaDMData_Type.tp_dict;
for(method=oaInterPointerAppDef_oaDMData_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaDMFile
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaDMFile_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaDMFile_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDMFileObject* self = (PyoaInterPointerAppDef_oaDMFileObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaDMFile)
{
PyParamoaInterPointerAppDef_oaDMFile p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaDMFile_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaDMFile, Choices are:\n"
" (oaInterPointerAppDef_oaDMFile)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaDMFile_tp_dealloc(PyoaInterPointerAppDef_oaDMFileObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaDMFile_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaDMFile value;
int convert_status=PyoaInterPointerAppDef_oaDMFile_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[51];
sprintf(buffer,"<oaInterPointerAppDef_oaDMFile::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaDMFile_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaDMFile v1;
PyParamoaInterPointerAppDef_oaDMFile v2;
int convert_status1=PyoaInterPointerAppDef_oaDMFile_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaDMFile_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaDMFile_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaDMFile* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaDMFile_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaDMFile**) ((PyoaInterPointerAppDef_oaDMFileObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaDMFile Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaDMFile_FromoaInterPointerAppDef_oaDMFile(oaInterPointerAppDef_oaDMFile** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaDMFile* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaDMFile_Type.tp_alloc(&PyoaInterPointerAppDef_oaDMFile_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDMFileObject* self = (PyoaInterPointerAppDef_oaDMFileObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaDMFile_FromoaInterPointerAppDef_oaDMFile(oaInterPointerAppDef_oaDMFile* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaDMFile_Type.tp_alloc(&PyoaInterPointerAppDef_oaDMFile_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDMFileObject* self = (PyoaInterPointerAppDef_oaDMFileObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDMFile_get_doc[] =
"Class: oaInterPointerAppDef_oaDMFile, Function: get\n"
" Paramegers: (oaDMFile)\n"
" Calls: oaObject* get(const oaDMFile* object)\n"
" Signature: get|ptr-oaObject|cptr-oaDMFile,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaDMFile_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaDMFile data;
int convert_status=PyoaInterPointerAppDef_oaDMFile_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaDMFileObject* self=(PyoaInterPointerAppDef_oaDMFileObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaDMFile p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaDMFile_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDMFile_set_doc[] =
"Class: oaInterPointerAppDef_oaDMFile, Function: set\n"
" Paramegers: (oaDMFile,oaObject)\n"
" Calls: void set(oaDMFile* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaDMFile,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaDMFile_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaDMFile data;
int convert_status=PyoaInterPointerAppDef_oaDMFile_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaDMFileObject* self=(PyoaInterPointerAppDef_oaDMFileObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaDMFile p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaDMFile_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDMFile_isNull_doc[] =
"Class: oaInterPointerAppDef_oaDMFile, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaDMFile_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaDMFile data;
int convert_status=PyoaInterPointerAppDef_oaDMFile_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaDMFile_assign_doc[] =
"Class: oaInterPointerAppDef_oaDMFile, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaDMFile_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaDMFile data;
int convert_status=PyoaInterPointerAppDef_oaDMFile_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaDMFile p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaDMFile_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaDMFile_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaDMFile_get,METH_VARARGS,oaInterPointerAppDef_oaDMFile_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaDMFile_set,METH_VARARGS,oaInterPointerAppDef_oaDMFile_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaDMFile_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaDMFile_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaDMFile_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaDMFile_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDMFile_doc[] =
"Class: oaInterPointerAppDef_oaDMFile\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaDMFile)\n"
" Calls: (const oaInterPointerAppDef_oaDMFile&)\n"
" Signature: oaInterPointerAppDef_oaDMFile||cref-oaInterPointerAppDef_oaDMFile,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaDMFile_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaDMFile",
sizeof(PyoaInterPointerAppDef_oaDMFileObject),
0,
(destructor)oaInterPointerAppDef_oaDMFile_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaDMFile_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaDMFile_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaDMFile_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaDMFile_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaDMFile_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDMFile_static_find_doc[] =
"Class: oaInterPointerAppDef_oaDMFile, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaDMFile* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaDMFile|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaDMFile* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaDMFile|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaDMFile_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaDMFilep result= (oaInterPointerAppDef_oaDMFile::find(p1.Data()));
return PyoaInterPointerAppDef_oaDMFile_FromoaInterPointerAppDef_oaDMFile(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDMFilep result= (oaInterPointerAppDef_oaDMFile::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDMFile_FromoaInterPointerAppDef_oaDMFile(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaDMFile, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDMFile_static_get_doc[] =
"Class: oaInterPointerAppDef_oaDMFile, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaDMFile* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDMFile|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaDMFile* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDMFile|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaDMFile* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDMFile|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaDMFile* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDMFile|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaDMFile_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaDMFilep result= (oaInterPointerAppDef_oaDMFile::get(p1.Data()));
return PyoaInterPointerAppDef_oaDMFile_FromoaInterPointerAppDef_oaDMFile(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaDMFilep result= (oaInterPointerAppDef_oaDMFile::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDMFile_FromoaInterPointerAppDef_oaDMFile(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDMFilep result= (oaInterPointerAppDef_oaDMFile::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDMFile_FromoaInterPointerAppDef_oaDMFile(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDMFilep result= (oaInterPointerAppDef_oaDMFile::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaDMFile_FromoaInterPointerAppDef_oaDMFile(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaDMFile, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaDMFile_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaDMFile_static_find,METH_VARARGS,oaInterPointerAppDef_oaDMFile_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaDMFile_static_get,METH_VARARGS,oaInterPointerAppDef_oaDMFile_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaDMFile_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaDMFile_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaDMFile\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaDMFile",
(PyObject*)(&PyoaInterPointerAppDef_oaDMFile_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaDMFile\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaDMFile_Type.tp_dict;
for(method=oaInterPointerAppDef_oaDMFile_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaDerivedLayerParam
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaDerivedLayerParam_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaDerivedLayerParam_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDerivedLayerParamObject* self = (PyoaInterPointerAppDef_oaDerivedLayerParamObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaDerivedLayerParam)
{
PyParamoaInterPointerAppDef_oaDerivedLayerParam p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaDerivedLayerParam_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaDerivedLayerParam, Choices are:\n"
" (oaInterPointerAppDef_oaDerivedLayerParam)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaDerivedLayerParam_tp_dealloc(PyoaInterPointerAppDef_oaDerivedLayerParamObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaDerivedLayerParam_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaDerivedLayerParam value;
int convert_status=PyoaInterPointerAppDef_oaDerivedLayerParam_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[62];
sprintf(buffer,"<oaInterPointerAppDef_oaDerivedLayerParam::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaDerivedLayerParam_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaDerivedLayerParam v1;
PyParamoaInterPointerAppDef_oaDerivedLayerParam v2;
int convert_status1=PyoaInterPointerAppDef_oaDerivedLayerParam_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaDerivedLayerParam_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaDerivedLayerParam_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaDerivedLayerParam* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaDerivedLayerParam_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaDerivedLayerParam**) ((PyoaInterPointerAppDef_oaDerivedLayerParamObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaDerivedLayerParam Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaDerivedLayerParam_FromoaInterPointerAppDef_oaDerivedLayerParam(oaInterPointerAppDef_oaDerivedLayerParam** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaDerivedLayerParam* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaDerivedLayerParam_Type.tp_alloc(&PyoaInterPointerAppDef_oaDerivedLayerParam_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDerivedLayerParamObject* self = (PyoaInterPointerAppDef_oaDerivedLayerParamObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaDerivedLayerParam_FromoaInterPointerAppDef_oaDerivedLayerParam(oaInterPointerAppDef_oaDerivedLayerParam* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaDerivedLayerParam_Type.tp_alloc(&PyoaInterPointerAppDef_oaDerivedLayerParam_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDerivedLayerParamObject* self = (PyoaInterPointerAppDef_oaDerivedLayerParamObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDerivedLayerParam_get_doc[] =
"Class: oaInterPointerAppDef_oaDerivedLayerParam, Function: get\n"
" Paramegers: (oaDerivedLayerParam)\n"
" Calls: oaObject* get(const oaDerivedLayerParam* object)\n"
" Signature: get|ptr-oaObject|cptr-oaDerivedLayerParam,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaDerivedLayerParam_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaDerivedLayerParam data;
int convert_status=PyoaInterPointerAppDef_oaDerivedLayerParam_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaDerivedLayerParamObject* self=(PyoaInterPointerAppDef_oaDerivedLayerParamObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaDerivedLayerParam p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaDerivedLayerParam_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDerivedLayerParam_set_doc[] =
"Class: oaInterPointerAppDef_oaDerivedLayerParam, Function: set\n"
" Paramegers: (oaDerivedLayerParam,oaObject)\n"
" Calls: void set(oaDerivedLayerParam* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaDerivedLayerParam,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaDerivedLayerParam_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaDerivedLayerParam data;
int convert_status=PyoaInterPointerAppDef_oaDerivedLayerParam_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaDerivedLayerParamObject* self=(PyoaInterPointerAppDef_oaDerivedLayerParamObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaDerivedLayerParam p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaDerivedLayerParam_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDerivedLayerParam_isNull_doc[] =
"Class: oaInterPointerAppDef_oaDerivedLayerParam, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaDerivedLayerParam_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaDerivedLayerParam data;
int convert_status=PyoaInterPointerAppDef_oaDerivedLayerParam_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaDerivedLayerParam_assign_doc[] =
"Class: oaInterPointerAppDef_oaDerivedLayerParam, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaDerivedLayerParam_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaDerivedLayerParam data;
int convert_status=PyoaInterPointerAppDef_oaDerivedLayerParam_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaDerivedLayerParam p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaDerivedLayerParam_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaDerivedLayerParam_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaDerivedLayerParam_get,METH_VARARGS,oaInterPointerAppDef_oaDerivedLayerParam_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaDerivedLayerParam_set,METH_VARARGS,oaInterPointerAppDef_oaDerivedLayerParam_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaDerivedLayerParam_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaDerivedLayerParam_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaDerivedLayerParam_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaDerivedLayerParam_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDerivedLayerParam_doc[] =
"Class: oaInterPointerAppDef_oaDerivedLayerParam\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaDerivedLayerParam)\n"
" Calls: (const oaInterPointerAppDef_oaDerivedLayerParam&)\n"
" Signature: oaInterPointerAppDef_oaDerivedLayerParam||cref-oaInterPointerAppDef_oaDerivedLayerParam,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaDerivedLayerParam_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaDerivedLayerParam",
sizeof(PyoaInterPointerAppDef_oaDerivedLayerParamObject),
0,
(destructor)oaInterPointerAppDef_oaDerivedLayerParam_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaDerivedLayerParam_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaDerivedLayerParam_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaDerivedLayerParam_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaDerivedLayerParam_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaDerivedLayerParam_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDerivedLayerParam_static_find_doc[] =
"Class: oaInterPointerAppDef_oaDerivedLayerParam, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaDerivedLayerParam* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaDerivedLayerParam|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaDerivedLayerParam* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaDerivedLayerParam|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaDerivedLayerParam_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaDerivedLayerParamp result= (oaInterPointerAppDef_oaDerivedLayerParam::find(p1.Data()));
return PyoaInterPointerAppDef_oaDerivedLayerParam_FromoaInterPointerAppDef_oaDerivedLayerParam(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDerivedLayerParamp result= (oaInterPointerAppDef_oaDerivedLayerParam::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDerivedLayerParam_FromoaInterPointerAppDef_oaDerivedLayerParam(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaDerivedLayerParam, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDerivedLayerParam_static_get_doc[] =
"Class: oaInterPointerAppDef_oaDerivedLayerParam, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaDerivedLayerParam* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDerivedLayerParam|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaDerivedLayerParam* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDerivedLayerParam|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaDerivedLayerParam* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDerivedLayerParam|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaDerivedLayerParam* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDerivedLayerParam|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaDerivedLayerParam_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaDerivedLayerParamp result= (oaInterPointerAppDef_oaDerivedLayerParam::get(p1.Data()));
return PyoaInterPointerAppDef_oaDerivedLayerParam_FromoaInterPointerAppDef_oaDerivedLayerParam(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaDerivedLayerParamp result= (oaInterPointerAppDef_oaDerivedLayerParam::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDerivedLayerParam_FromoaInterPointerAppDef_oaDerivedLayerParam(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDerivedLayerParamp result= (oaInterPointerAppDef_oaDerivedLayerParam::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDerivedLayerParam_FromoaInterPointerAppDef_oaDerivedLayerParam(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDerivedLayerParamp result= (oaInterPointerAppDef_oaDerivedLayerParam::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaDerivedLayerParam_FromoaInterPointerAppDef_oaDerivedLayerParam(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaDerivedLayerParam, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaDerivedLayerParam_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaDerivedLayerParam_static_find,METH_VARARGS,oaInterPointerAppDef_oaDerivedLayerParam_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaDerivedLayerParam_static_get,METH_VARARGS,oaInterPointerAppDef_oaDerivedLayerParam_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaDerivedLayerParam_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaDerivedLayerParam_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaDerivedLayerParam\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaDerivedLayerParam",
(PyObject*)(&PyoaInterPointerAppDef_oaDerivedLayerParam_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaDerivedLayerParam\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaDerivedLayerParam_Type.tp_dict;
for(method=oaInterPointerAppDef_oaDerivedLayerParam_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaDesign
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaDesign_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaDesign_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDesignObject* self = (PyoaInterPointerAppDef_oaDesignObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaDesign)
{
PyParamoaInterPointerAppDef_oaDesign p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaDesign_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaDesign, Choices are:\n"
" (oaInterPointerAppDef_oaDesign)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaDesign_tp_dealloc(PyoaInterPointerAppDef_oaDesignObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaDesign_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaDesign value;
int convert_status=PyoaInterPointerAppDef_oaDesign_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[51];
sprintf(buffer,"<oaInterPointerAppDef_oaDesign::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaDesign_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaDesign v1;
PyParamoaInterPointerAppDef_oaDesign v2;
int convert_status1=PyoaInterPointerAppDef_oaDesign_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaDesign_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaDesign_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaDesign* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaDesign_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaDesign**) ((PyoaInterPointerAppDef_oaDesignObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaDesign Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaDesign_FromoaInterPointerAppDef_oaDesign(oaInterPointerAppDef_oaDesign** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaDesign* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaDesign_Type.tp_alloc(&PyoaInterPointerAppDef_oaDesign_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDesignObject* self = (PyoaInterPointerAppDef_oaDesignObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaDesign_FromoaInterPointerAppDef_oaDesign(oaInterPointerAppDef_oaDesign* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaDesign_Type.tp_alloc(&PyoaInterPointerAppDef_oaDesign_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDesignObject* self = (PyoaInterPointerAppDef_oaDesignObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDesign_get_doc[] =
"Class: oaInterPointerAppDef_oaDesign, Function: get\n"
" Paramegers: (oaDesign)\n"
" Calls: oaObject* get(const oaDesign* object)\n"
" Signature: get|ptr-oaObject|cptr-oaDesign,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaDesign_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaDesign data;
int convert_status=PyoaInterPointerAppDef_oaDesign_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaDesignObject* self=(PyoaInterPointerAppDef_oaDesignObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaDesign p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaDesign_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDesign_set_doc[] =
"Class: oaInterPointerAppDef_oaDesign, Function: set\n"
" Paramegers: (oaDesign,oaObject)\n"
" Calls: void set(oaDesign* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaDesign,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaDesign_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaDesign data;
int convert_status=PyoaInterPointerAppDef_oaDesign_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaDesignObject* self=(PyoaInterPointerAppDef_oaDesignObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaDesign p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaDesign_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDesign_isNull_doc[] =
"Class: oaInterPointerAppDef_oaDesign, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaDesign_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaDesign data;
int convert_status=PyoaInterPointerAppDef_oaDesign_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaDesign_assign_doc[] =
"Class: oaInterPointerAppDef_oaDesign, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaDesign_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaDesign data;
int convert_status=PyoaInterPointerAppDef_oaDesign_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaDesign p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaDesign_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaDesign_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaDesign_get,METH_VARARGS,oaInterPointerAppDef_oaDesign_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaDesign_set,METH_VARARGS,oaInterPointerAppDef_oaDesign_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaDesign_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaDesign_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaDesign_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaDesign_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDesign_doc[] =
"Class: oaInterPointerAppDef_oaDesign\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaDesign)\n"
" Calls: (const oaInterPointerAppDef_oaDesign&)\n"
" Signature: oaInterPointerAppDef_oaDesign||cref-oaInterPointerAppDef_oaDesign,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaDesign_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaDesign",
sizeof(PyoaInterPointerAppDef_oaDesignObject),
0,
(destructor)oaInterPointerAppDef_oaDesign_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaDesign_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaDesign_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaDesign_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaDesign_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaDesign_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDesign_static_find_doc[] =
"Class: oaInterPointerAppDef_oaDesign, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaDesign* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaDesign|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaDesign* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaDesign|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaDesign_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaDesignp result= (oaInterPointerAppDef_oaDesign::find(p1.Data()));
return PyoaInterPointerAppDef_oaDesign_FromoaInterPointerAppDef_oaDesign(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDesignp result= (oaInterPointerAppDef_oaDesign::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDesign_FromoaInterPointerAppDef_oaDesign(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaDesign, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDesign_static_get_doc[] =
"Class: oaInterPointerAppDef_oaDesign, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaDesign* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDesign|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaDesign* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDesign|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaDesign* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDesign|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaDesign* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDesign|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaDesign_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaDesignp result= (oaInterPointerAppDef_oaDesign::get(p1.Data()));
return PyoaInterPointerAppDef_oaDesign_FromoaInterPointerAppDef_oaDesign(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaDesignp result= (oaInterPointerAppDef_oaDesign::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDesign_FromoaInterPointerAppDef_oaDesign(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDesignp result= (oaInterPointerAppDef_oaDesign::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDesign_FromoaInterPointerAppDef_oaDesign(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDesignp result= (oaInterPointerAppDef_oaDesign::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaDesign_FromoaInterPointerAppDef_oaDesign(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaDesign, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaDesign_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaDesign_static_find,METH_VARARGS,oaInterPointerAppDef_oaDesign_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaDesign_static_get,METH_VARARGS,oaInterPointerAppDef_oaDesign_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaDesign_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaDesign_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaDesign\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaDesign",
(PyObject*)(&PyoaInterPointerAppDef_oaDesign_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaDesign\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaDesign_Type.tp_dict;
for(method=oaInterPointerAppDef_oaDesign_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaDesignInst
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaDesignInst_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaDesignInst_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDesignInstObject* self = (PyoaInterPointerAppDef_oaDesignInstObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaDesignInst)
{
PyParamoaInterPointerAppDef_oaDesignInst p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaDesignInst_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaDesignInst, Choices are:\n"
" (oaInterPointerAppDef_oaDesignInst)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaDesignInst_tp_dealloc(PyoaInterPointerAppDef_oaDesignInstObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaDesignInst_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaDesignInst value;
int convert_status=PyoaInterPointerAppDef_oaDesignInst_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[55];
sprintf(buffer,"<oaInterPointerAppDef_oaDesignInst::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaDesignInst_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaDesignInst v1;
PyParamoaInterPointerAppDef_oaDesignInst v2;
int convert_status1=PyoaInterPointerAppDef_oaDesignInst_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaDesignInst_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaDesignInst_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaDesignInst* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaDesignInst_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaDesignInst**) ((PyoaInterPointerAppDef_oaDesignInstObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaDesignInst Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaDesignInst_FromoaInterPointerAppDef_oaDesignInst(oaInterPointerAppDef_oaDesignInst** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaDesignInst* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaDesignInst_Type.tp_alloc(&PyoaInterPointerAppDef_oaDesignInst_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDesignInstObject* self = (PyoaInterPointerAppDef_oaDesignInstObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaDesignInst_FromoaInterPointerAppDef_oaDesignInst(oaInterPointerAppDef_oaDesignInst* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaDesignInst_Type.tp_alloc(&PyoaInterPointerAppDef_oaDesignInst_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDesignInstObject* self = (PyoaInterPointerAppDef_oaDesignInstObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDesignInst_get_doc[] =
"Class: oaInterPointerAppDef_oaDesignInst, Function: get\n"
" Paramegers: (oaDesignInst)\n"
" Calls: oaObject* get(const oaDesignInst* object)\n"
" Signature: get|ptr-oaObject|cptr-oaDesignInst,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaDesignInst_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaDesignInst data;
int convert_status=PyoaInterPointerAppDef_oaDesignInst_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaDesignInstObject* self=(PyoaInterPointerAppDef_oaDesignInstObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaDesignInst p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaDesignInst_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDesignInst_set_doc[] =
"Class: oaInterPointerAppDef_oaDesignInst, Function: set\n"
" Paramegers: (oaDesignInst,oaObject)\n"
" Calls: void set(oaDesignInst* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaDesignInst,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaDesignInst_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaDesignInst data;
int convert_status=PyoaInterPointerAppDef_oaDesignInst_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaDesignInstObject* self=(PyoaInterPointerAppDef_oaDesignInstObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaDesignInst p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaDesignInst_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDesignInst_isNull_doc[] =
"Class: oaInterPointerAppDef_oaDesignInst, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaDesignInst_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaDesignInst data;
int convert_status=PyoaInterPointerAppDef_oaDesignInst_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaDesignInst_assign_doc[] =
"Class: oaInterPointerAppDef_oaDesignInst, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaDesignInst_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaDesignInst data;
int convert_status=PyoaInterPointerAppDef_oaDesignInst_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaDesignInst p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaDesignInst_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaDesignInst_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaDesignInst_get,METH_VARARGS,oaInterPointerAppDef_oaDesignInst_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaDesignInst_set,METH_VARARGS,oaInterPointerAppDef_oaDesignInst_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaDesignInst_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaDesignInst_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaDesignInst_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaDesignInst_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDesignInst_doc[] =
"Class: oaInterPointerAppDef_oaDesignInst\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaDesignInst)\n"
" Calls: (const oaInterPointerAppDef_oaDesignInst&)\n"
" Signature: oaInterPointerAppDef_oaDesignInst||cref-oaInterPointerAppDef_oaDesignInst,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaDesignInst_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaDesignInst",
sizeof(PyoaInterPointerAppDef_oaDesignInstObject),
0,
(destructor)oaInterPointerAppDef_oaDesignInst_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaDesignInst_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaDesignInst_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaDesignInst_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaDesignInst_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaDesignInst_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDesignInst_static_find_doc[] =
"Class: oaInterPointerAppDef_oaDesignInst, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaDesignInst* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaDesignInst|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaDesignInst* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaDesignInst|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaDesignInst_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaDesignInstp result= (oaInterPointerAppDef_oaDesignInst::find(p1.Data()));
return PyoaInterPointerAppDef_oaDesignInst_FromoaInterPointerAppDef_oaDesignInst(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDesignInstp result= (oaInterPointerAppDef_oaDesignInst::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDesignInst_FromoaInterPointerAppDef_oaDesignInst(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaDesignInst, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDesignInst_static_get_doc[] =
"Class: oaInterPointerAppDef_oaDesignInst, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaDesignInst* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDesignInst|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaDesignInst* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDesignInst|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaDesignInst* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDesignInst|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaDesignInst* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDesignInst|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaDesignInst_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaDesignInstp result= (oaInterPointerAppDef_oaDesignInst::get(p1.Data()));
return PyoaInterPointerAppDef_oaDesignInst_FromoaInterPointerAppDef_oaDesignInst(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaDesignInstp result= (oaInterPointerAppDef_oaDesignInst::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDesignInst_FromoaInterPointerAppDef_oaDesignInst(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDesignInstp result= (oaInterPointerAppDef_oaDesignInst::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDesignInst_FromoaInterPointerAppDef_oaDesignInst(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDesignInstp result= (oaInterPointerAppDef_oaDesignInst::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaDesignInst_FromoaInterPointerAppDef_oaDesignInst(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaDesignInst, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaDesignInst_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaDesignInst_static_find,METH_VARARGS,oaInterPointerAppDef_oaDesignInst_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaDesignInst_static_get,METH_VARARGS,oaInterPointerAppDef_oaDesignInst_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaDesignInst_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaDesignInst_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaDesignInst\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaDesignInst",
(PyObject*)(&PyoaInterPointerAppDef_oaDesignInst_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaDesignInst\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaDesignInst_Type.tp_dict;
for(method=oaInterPointerAppDef_oaDesignInst_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaDevice
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaDevice_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaDevice_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDeviceObject* self = (PyoaInterPointerAppDef_oaDeviceObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaDevice)
{
PyParamoaInterPointerAppDef_oaDevice p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaDevice_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaDevice, Choices are:\n"
" (oaInterPointerAppDef_oaDevice)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaDevice_tp_dealloc(PyoaInterPointerAppDef_oaDeviceObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaDevice_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaDevice value;
int convert_status=PyoaInterPointerAppDef_oaDevice_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[51];
sprintf(buffer,"<oaInterPointerAppDef_oaDevice::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaDevice_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaDevice v1;
PyParamoaInterPointerAppDef_oaDevice v2;
int convert_status1=PyoaInterPointerAppDef_oaDevice_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaDevice_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaDevice_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaDevice* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaDevice_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaDevice**) ((PyoaInterPointerAppDef_oaDeviceObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaDevice Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaDevice_FromoaInterPointerAppDef_oaDevice(oaInterPointerAppDef_oaDevice** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaDevice* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaDevice_Type.tp_alloc(&PyoaInterPointerAppDef_oaDevice_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDeviceObject* self = (PyoaInterPointerAppDef_oaDeviceObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaDevice_FromoaInterPointerAppDef_oaDevice(oaInterPointerAppDef_oaDevice* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaDevice_Type.tp_alloc(&PyoaInterPointerAppDef_oaDevice_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaDeviceObject* self = (PyoaInterPointerAppDef_oaDeviceObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDevice_get_doc[] =
"Class: oaInterPointerAppDef_oaDevice, Function: get\n"
" Paramegers: (oaDevice)\n"
" Calls: oaObject* get(const oaDevice* object)\n"
" Signature: get|ptr-oaObject|cptr-oaDevice,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaDevice_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaDevice data;
int convert_status=PyoaInterPointerAppDef_oaDevice_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaDeviceObject* self=(PyoaInterPointerAppDef_oaDeviceObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaDevice p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaDevice_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDevice_set_doc[] =
"Class: oaInterPointerAppDef_oaDevice, Function: set\n"
" Paramegers: (oaDevice,oaObject)\n"
" Calls: void set(oaDevice* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaDevice,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaDevice_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaDevice data;
int convert_status=PyoaInterPointerAppDef_oaDevice_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaDeviceObject* self=(PyoaInterPointerAppDef_oaDeviceObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaDevice p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaDevice_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDevice_isNull_doc[] =
"Class: oaInterPointerAppDef_oaDevice, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaDevice_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaDevice data;
int convert_status=PyoaInterPointerAppDef_oaDevice_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaDevice_assign_doc[] =
"Class: oaInterPointerAppDef_oaDevice, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaDevice_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaDevice data;
int convert_status=PyoaInterPointerAppDef_oaDevice_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaDevice p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaDevice_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaDevice_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaDevice_get,METH_VARARGS,oaInterPointerAppDef_oaDevice_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaDevice_set,METH_VARARGS,oaInterPointerAppDef_oaDevice_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaDevice_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaDevice_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaDevice_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaDevice_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDevice_doc[] =
"Class: oaInterPointerAppDef_oaDevice\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaDevice)\n"
" Calls: (const oaInterPointerAppDef_oaDevice&)\n"
" Signature: oaInterPointerAppDef_oaDevice||cref-oaInterPointerAppDef_oaDevice,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaDevice_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaDevice",
sizeof(PyoaInterPointerAppDef_oaDeviceObject),
0,
(destructor)oaInterPointerAppDef_oaDevice_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaDevice_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaDevice_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaDevice_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaDevice_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaDevice_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDevice_static_find_doc[] =
"Class: oaInterPointerAppDef_oaDevice, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaDevice* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaDevice|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaDevice* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaDevice|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaDevice_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaDevicep result= (oaInterPointerAppDef_oaDevice::find(p1.Data()));
return PyoaInterPointerAppDef_oaDevice_FromoaInterPointerAppDef_oaDevice(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDevicep result= (oaInterPointerAppDef_oaDevice::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDevice_FromoaInterPointerAppDef_oaDevice(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaDevice, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaDevice_static_get_doc[] =
"Class: oaInterPointerAppDef_oaDevice, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaDevice* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDevice|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaDevice* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDevice|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaDevice* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDevice|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaDevice* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaDevice|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaDevice_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaDevicep result= (oaInterPointerAppDef_oaDevice::get(p1.Data()));
return PyoaInterPointerAppDef_oaDevice_FromoaInterPointerAppDef_oaDevice(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaDevicep result= (oaInterPointerAppDef_oaDevice::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDevice_FromoaInterPointerAppDef_oaDevice(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDevicep result= (oaInterPointerAppDef_oaDevice::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaDevice_FromoaInterPointerAppDef_oaDevice(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaDevicep result= (oaInterPointerAppDef_oaDevice::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaDevice_FromoaInterPointerAppDef_oaDevice(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaDevice, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaDevice_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaDevice_static_find,METH_VARARGS,oaInterPointerAppDef_oaDevice_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaDevice_static_get,METH_VARARGS,oaInterPointerAppDef_oaDevice_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaDevice_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaDevice_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaDevice\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaDevice",
(PyObject*)(&PyoaInterPointerAppDef_oaDevice_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaDevice\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaDevice_Type.tp_dict;
for(method=oaInterPointerAppDef_oaDevice_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaElmore
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaElmore_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaElmore_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaElmoreObject* self = (PyoaInterPointerAppDef_oaElmoreObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaElmore)
{
PyParamoaInterPointerAppDef_oaElmore p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaElmore_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaElmore, Choices are:\n"
" (oaInterPointerAppDef_oaElmore)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaElmore_tp_dealloc(PyoaInterPointerAppDef_oaElmoreObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaElmore_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaElmore value;
int convert_status=PyoaInterPointerAppDef_oaElmore_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[51];
sprintf(buffer,"<oaInterPointerAppDef_oaElmore::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaElmore_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaElmore v1;
PyParamoaInterPointerAppDef_oaElmore v2;
int convert_status1=PyoaInterPointerAppDef_oaElmore_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaElmore_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaElmore_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaElmore* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaElmore_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaElmore**) ((PyoaInterPointerAppDef_oaElmoreObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaElmore Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaElmore_FromoaInterPointerAppDef_oaElmore(oaInterPointerAppDef_oaElmore** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaElmore* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaElmore_Type.tp_alloc(&PyoaInterPointerAppDef_oaElmore_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaElmoreObject* self = (PyoaInterPointerAppDef_oaElmoreObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaElmore_FromoaInterPointerAppDef_oaElmore(oaInterPointerAppDef_oaElmore* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaElmore_Type.tp_alloc(&PyoaInterPointerAppDef_oaElmore_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaElmoreObject* self = (PyoaInterPointerAppDef_oaElmoreObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaElmore_get_doc[] =
"Class: oaInterPointerAppDef_oaElmore, Function: get\n"
" Paramegers: (oaElmore)\n"
" Calls: oaObject* get(const oaElmore* object)\n"
" Signature: get|ptr-oaObject|cptr-oaElmore,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaElmore_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaElmore data;
int convert_status=PyoaInterPointerAppDef_oaElmore_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaElmoreObject* self=(PyoaInterPointerAppDef_oaElmoreObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaElmore p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaElmore_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaElmore_set_doc[] =
"Class: oaInterPointerAppDef_oaElmore, Function: set\n"
" Paramegers: (oaElmore,oaObject)\n"
" Calls: void set(oaElmore* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaElmore,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaElmore_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaElmore data;
int convert_status=PyoaInterPointerAppDef_oaElmore_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaElmoreObject* self=(PyoaInterPointerAppDef_oaElmoreObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaElmore p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaElmore_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaElmore_isNull_doc[] =
"Class: oaInterPointerAppDef_oaElmore, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaElmore_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaElmore data;
int convert_status=PyoaInterPointerAppDef_oaElmore_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaElmore_assign_doc[] =
"Class: oaInterPointerAppDef_oaElmore, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaElmore_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaElmore data;
int convert_status=PyoaInterPointerAppDef_oaElmore_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaElmore p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaElmore_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaElmore_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaElmore_get,METH_VARARGS,oaInterPointerAppDef_oaElmore_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaElmore_set,METH_VARARGS,oaInterPointerAppDef_oaElmore_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaElmore_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaElmore_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaElmore_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaElmore_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaElmore_doc[] =
"Class: oaInterPointerAppDef_oaElmore\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaElmore)\n"
" Calls: (const oaInterPointerAppDef_oaElmore&)\n"
" Signature: oaInterPointerAppDef_oaElmore||cref-oaInterPointerAppDef_oaElmore,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaElmore_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaElmore",
sizeof(PyoaInterPointerAppDef_oaElmoreObject),
0,
(destructor)oaInterPointerAppDef_oaElmore_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaElmore_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaElmore_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaElmore_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaElmore_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaElmore_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaElmore_static_find_doc[] =
"Class: oaInterPointerAppDef_oaElmore, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaElmore* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaElmore|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaElmore* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaElmore|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaElmore_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaElmorep result= (oaInterPointerAppDef_oaElmore::find(p1.Data()));
return PyoaInterPointerAppDef_oaElmore_FromoaInterPointerAppDef_oaElmore(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaElmorep result= (oaInterPointerAppDef_oaElmore::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaElmore_FromoaInterPointerAppDef_oaElmore(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaElmore, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaElmore_static_get_doc[] =
"Class: oaInterPointerAppDef_oaElmore, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaElmore* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaElmore|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaElmore* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaElmore|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaElmore* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaElmore|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaElmore* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaElmore|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaElmore_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaElmorep result= (oaInterPointerAppDef_oaElmore::get(p1.Data()));
return PyoaInterPointerAppDef_oaElmore_FromoaInterPointerAppDef_oaElmore(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaElmorep result= (oaInterPointerAppDef_oaElmore::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaElmore_FromoaInterPointerAppDef_oaElmore(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaElmorep result= (oaInterPointerAppDef_oaElmore::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaElmore_FromoaInterPointerAppDef_oaElmore(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaElmorep result= (oaInterPointerAppDef_oaElmore::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaElmore_FromoaInterPointerAppDef_oaElmore(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaElmore, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaElmore_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaElmore_static_find,METH_VARARGS,oaInterPointerAppDef_oaElmore_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaElmore_static_get,METH_VARARGS,oaInterPointerAppDef_oaElmore_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaElmore_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaElmore_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaElmore\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaElmore",
(PyObject*)(&PyoaInterPointerAppDef_oaElmore_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaElmore\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaElmore_Type.tp_dict;
for(method=oaInterPointerAppDef_oaElmore_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaFigGroup
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaFigGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaFigGroup_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaFigGroupObject* self = (PyoaInterPointerAppDef_oaFigGroupObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaFigGroup)
{
PyParamoaInterPointerAppDef_oaFigGroup p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaFigGroup_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaFigGroup, Choices are:\n"
" (oaInterPointerAppDef_oaFigGroup)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaFigGroup_tp_dealloc(PyoaInterPointerAppDef_oaFigGroupObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaFigGroup_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaFigGroup value;
int convert_status=PyoaInterPointerAppDef_oaFigGroup_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[53];
sprintf(buffer,"<oaInterPointerAppDef_oaFigGroup::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaFigGroup_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaFigGroup v1;
PyParamoaInterPointerAppDef_oaFigGroup v2;
int convert_status1=PyoaInterPointerAppDef_oaFigGroup_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaFigGroup_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaFigGroup_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaFigGroup* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaFigGroup_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaFigGroup**) ((PyoaInterPointerAppDef_oaFigGroupObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaFigGroup Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaFigGroup_FromoaInterPointerAppDef_oaFigGroup(oaInterPointerAppDef_oaFigGroup** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaFigGroup* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaFigGroup_Type.tp_alloc(&PyoaInterPointerAppDef_oaFigGroup_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaFigGroupObject* self = (PyoaInterPointerAppDef_oaFigGroupObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaFigGroup_FromoaInterPointerAppDef_oaFigGroup(oaInterPointerAppDef_oaFigGroup* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaFigGroup_Type.tp_alloc(&PyoaInterPointerAppDef_oaFigGroup_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaFigGroupObject* self = (PyoaInterPointerAppDef_oaFigGroupObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFigGroup_get_doc[] =
"Class: oaInterPointerAppDef_oaFigGroup, Function: get\n"
" Paramegers: (oaFigGroup)\n"
" Calls: oaObject* get(const oaFigGroup* object)\n"
" Signature: get|ptr-oaObject|cptr-oaFigGroup,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaFigGroup_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaFigGroup data;
int convert_status=PyoaInterPointerAppDef_oaFigGroup_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaFigGroupObject* self=(PyoaInterPointerAppDef_oaFigGroupObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaFigGroup p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaFigGroup_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFigGroup_set_doc[] =
"Class: oaInterPointerAppDef_oaFigGroup, Function: set\n"
" Paramegers: (oaFigGroup,oaObject)\n"
" Calls: void set(oaFigGroup* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaFigGroup,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaFigGroup_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaFigGroup data;
int convert_status=PyoaInterPointerAppDef_oaFigGroup_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaFigGroupObject* self=(PyoaInterPointerAppDef_oaFigGroupObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaFigGroup p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaFigGroup_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFigGroup_isNull_doc[] =
"Class: oaInterPointerAppDef_oaFigGroup, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaFigGroup_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaFigGroup data;
int convert_status=PyoaInterPointerAppDef_oaFigGroup_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaFigGroup_assign_doc[] =
"Class: oaInterPointerAppDef_oaFigGroup, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaFigGroup_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaFigGroup data;
int convert_status=PyoaInterPointerAppDef_oaFigGroup_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaFigGroup p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaFigGroup_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaFigGroup_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaFigGroup_get,METH_VARARGS,oaInterPointerAppDef_oaFigGroup_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaFigGroup_set,METH_VARARGS,oaInterPointerAppDef_oaFigGroup_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaFigGroup_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaFigGroup_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaFigGroup_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaFigGroup_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFigGroup_doc[] =
"Class: oaInterPointerAppDef_oaFigGroup\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaFigGroup)\n"
" Calls: (const oaInterPointerAppDef_oaFigGroup&)\n"
" Signature: oaInterPointerAppDef_oaFigGroup||cref-oaInterPointerAppDef_oaFigGroup,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaFigGroup_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaFigGroup",
sizeof(PyoaInterPointerAppDef_oaFigGroupObject),
0,
(destructor)oaInterPointerAppDef_oaFigGroup_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaFigGroup_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaFigGroup_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaFigGroup_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaFigGroup_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaFigGroup_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFigGroup_static_find_doc[] =
"Class: oaInterPointerAppDef_oaFigGroup, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaFigGroup* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaFigGroup|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaFigGroup* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaFigGroup|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaFigGroup_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaFigGroupp result= (oaInterPointerAppDef_oaFigGroup::find(p1.Data()));
return PyoaInterPointerAppDef_oaFigGroup_FromoaInterPointerAppDef_oaFigGroup(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaFigGroupp result= (oaInterPointerAppDef_oaFigGroup::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaFigGroup_FromoaInterPointerAppDef_oaFigGroup(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaFigGroup, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFigGroup_static_get_doc[] =
"Class: oaInterPointerAppDef_oaFigGroup, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaFigGroup* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFigGroup|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaFigGroup* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFigGroup|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaFigGroup* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFigGroup|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaFigGroup* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFigGroup|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaFigGroup_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaFigGroupp result= (oaInterPointerAppDef_oaFigGroup::get(p1.Data()));
return PyoaInterPointerAppDef_oaFigGroup_FromoaInterPointerAppDef_oaFigGroup(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaFigGroupp result= (oaInterPointerAppDef_oaFigGroup::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaFigGroup_FromoaInterPointerAppDef_oaFigGroup(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaFigGroupp result= (oaInterPointerAppDef_oaFigGroup::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaFigGroup_FromoaInterPointerAppDef_oaFigGroup(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaFigGroupp result= (oaInterPointerAppDef_oaFigGroup::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaFigGroup_FromoaInterPointerAppDef_oaFigGroup(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaFigGroup, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaFigGroup_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaFigGroup_static_find,METH_VARARGS,oaInterPointerAppDef_oaFigGroup_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaFigGroup_static_get,METH_VARARGS,oaInterPointerAppDef_oaFigGroup_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaFigGroup_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaFigGroup_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaFigGroup\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaFigGroup",
(PyObject*)(&PyoaInterPointerAppDef_oaFigGroup_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaFigGroup\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaFigGroup_Type.tp_dict;
for(method=oaInterPointerAppDef_oaFigGroup_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaFigGroupMem
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaFigGroupMem_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaFigGroupMem_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaFigGroupMemObject* self = (PyoaInterPointerAppDef_oaFigGroupMemObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaFigGroupMem)
{
PyParamoaInterPointerAppDef_oaFigGroupMem p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaFigGroupMem_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaFigGroupMem, Choices are:\n"
" (oaInterPointerAppDef_oaFigGroupMem)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaFigGroupMem_tp_dealloc(PyoaInterPointerAppDef_oaFigGroupMemObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaFigGroupMem_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaFigGroupMem value;
int convert_status=PyoaInterPointerAppDef_oaFigGroupMem_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[56];
sprintf(buffer,"<oaInterPointerAppDef_oaFigGroupMem::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaFigGroupMem_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaFigGroupMem v1;
PyParamoaInterPointerAppDef_oaFigGroupMem v2;
int convert_status1=PyoaInterPointerAppDef_oaFigGroupMem_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaFigGroupMem_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaFigGroupMem_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaFigGroupMem* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaFigGroupMem_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaFigGroupMem**) ((PyoaInterPointerAppDef_oaFigGroupMemObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaFigGroupMem Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaFigGroupMem_FromoaInterPointerAppDef_oaFigGroupMem(oaInterPointerAppDef_oaFigGroupMem** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaFigGroupMem* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaFigGroupMem_Type.tp_alloc(&PyoaInterPointerAppDef_oaFigGroupMem_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaFigGroupMemObject* self = (PyoaInterPointerAppDef_oaFigGroupMemObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaFigGroupMem_FromoaInterPointerAppDef_oaFigGroupMem(oaInterPointerAppDef_oaFigGroupMem* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaFigGroupMem_Type.tp_alloc(&PyoaInterPointerAppDef_oaFigGroupMem_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaFigGroupMemObject* self = (PyoaInterPointerAppDef_oaFigGroupMemObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFigGroupMem_get_doc[] =
"Class: oaInterPointerAppDef_oaFigGroupMem, Function: get\n"
" Paramegers: (oaFigGroupMem)\n"
" Calls: oaObject* get(const oaFigGroupMem* object)\n"
" Signature: get|ptr-oaObject|cptr-oaFigGroupMem,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaFigGroupMem_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaFigGroupMem data;
int convert_status=PyoaInterPointerAppDef_oaFigGroupMem_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaFigGroupMemObject* self=(PyoaInterPointerAppDef_oaFigGroupMemObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaFigGroupMem p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaFigGroupMem_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFigGroupMem_set_doc[] =
"Class: oaInterPointerAppDef_oaFigGroupMem, Function: set\n"
" Paramegers: (oaFigGroupMem,oaObject)\n"
" Calls: void set(oaFigGroupMem* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaFigGroupMem,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaFigGroupMem_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaFigGroupMem data;
int convert_status=PyoaInterPointerAppDef_oaFigGroupMem_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaFigGroupMemObject* self=(PyoaInterPointerAppDef_oaFigGroupMemObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaFigGroupMem p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaFigGroupMem_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFigGroupMem_isNull_doc[] =
"Class: oaInterPointerAppDef_oaFigGroupMem, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaFigGroupMem_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaFigGroupMem data;
int convert_status=PyoaInterPointerAppDef_oaFigGroupMem_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaFigGroupMem_assign_doc[] =
"Class: oaInterPointerAppDef_oaFigGroupMem, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaFigGroupMem_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaFigGroupMem data;
int convert_status=PyoaInterPointerAppDef_oaFigGroupMem_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaFigGroupMem p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaFigGroupMem_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaFigGroupMem_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaFigGroupMem_get,METH_VARARGS,oaInterPointerAppDef_oaFigGroupMem_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaFigGroupMem_set,METH_VARARGS,oaInterPointerAppDef_oaFigGroupMem_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaFigGroupMem_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaFigGroupMem_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaFigGroupMem_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaFigGroupMem_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFigGroupMem_doc[] =
"Class: oaInterPointerAppDef_oaFigGroupMem\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaFigGroupMem)\n"
" Calls: (const oaInterPointerAppDef_oaFigGroupMem&)\n"
" Signature: oaInterPointerAppDef_oaFigGroupMem||cref-oaInterPointerAppDef_oaFigGroupMem,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaFigGroupMem_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaFigGroupMem",
sizeof(PyoaInterPointerAppDef_oaFigGroupMemObject),
0,
(destructor)oaInterPointerAppDef_oaFigGroupMem_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaFigGroupMem_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaFigGroupMem_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaFigGroupMem_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaFigGroupMem_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaFigGroupMem_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFigGroupMem_static_find_doc[] =
"Class: oaInterPointerAppDef_oaFigGroupMem, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaFigGroupMem* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaFigGroupMem|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaFigGroupMem* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaFigGroupMem|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaFigGroupMem_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaFigGroupMemp result= (oaInterPointerAppDef_oaFigGroupMem::find(p1.Data()));
return PyoaInterPointerAppDef_oaFigGroupMem_FromoaInterPointerAppDef_oaFigGroupMem(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaFigGroupMemp result= (oaInterPointerAppDef_oaFigGroupMem::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaFigGroupMem_FromoaInterPointerAppDef_oaFigGroupMem(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaFigGroupMem, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFigGroupMem_static_get_doc[] =
"Class: oaInterPointerAppDef_oaFigGroupMem, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaFigGroupMem* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFigGroupMem|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaFigGroupMem* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFigGroupMem|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaFigGroupMem* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFigGroupMem|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaFigGroupMem* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFigGroupMem|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaFigGroupMem_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaFigGroupMemp result= (oaInterPointerAppDef_oaFigGroupMem::get(p1.Data()));
return PyoaInterPointerAppDef_oaFigGroupMem_FromoaInterPointerAppDef_oaFigGroupMem(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaFigGroupMemp result= (oaInterPointerAppDef_oaFigGroupMem::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaFigGroupMem_FromoaInterPointerAppDef_oaFigGroupMem(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaFigGroupMemp result= (oaInterPointerAppDef_oaFigGroupMem::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaFigGroupMem_FromoaInterPointerAppDef_oaFigGroupMem(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaFigGroupMemp result= (oaInterPointerAppDef_oaFigGroupMem::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaFigGroupMem_FromoaInterPointerAppDef_oaFigGroupMem(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaFigGroupMem, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaFigGroupMem_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaFigGroupMem_static_find,METH_VARARGS,oaInterPointerAppDef_oaFigGroupMem_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaFigGroupMem_static_get,METH_VARARGS,oaInterPointerAppDef_oaFigGroupMem_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaFigGroupMem_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaFigGroupMem_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaFigGroupMem\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaFigGroupMem",
(PyObject*)(&PyoaInterPointerAppDef_oaFigGroupMem_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaFigGroupMem\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaFigGroupMem_Type.tp_dict;
for(method=oaInterPointerAppDef_oaFigGroupMem_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaFrame
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaFrame_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaFrame_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaFrameObject* self = (PyoaInterPointerAppDef_oaFrameObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaFrame)
{
PyParamoaInterPointerAppDef_oaFrame p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaFrame_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaFrame, Choices are:\n"
" (oaInterPointerAppDef_oaFrame)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaFrame_tp_dealloc(PyoaInterPointerAppDef_oaFrameObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaFrame_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaFrame value;
int convert_status=PyoaInterPointerAppDef_oaFrame_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[50];
sprintf(buffer,"<oaInterPointerAppDef_oaFrame::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaFrame_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaFrame v1;
PyParamoaInterPointerAppDef_oaFrame v2;
int convert_status1=PyoaInterPointerAppDef_oaFrame_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaFrame_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaFrame_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaFrame* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaFrame_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaFrame**) ((PyoaInterPointerAppDef_oaFrameObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaFrame Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaFrame_FromoaInterPointerAppDef_oaFrame(oaInterPointerAppDef_oaFrame** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaFrame* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaFrame_Type.tp_alloc(&PyoaInterPointerAppDef_oaFrame_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaFrameObject* self = (PyoaInterPointerAppDef_oaFrameObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaFrame_FromoaInterPointerAppDef_oaFrame(oaInterPointerAppDef_oaFrame* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaFrame_Type.tp_alloc(&PyoaInterPointerAppDef_oaFrame_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaFrameObject* self = (PyoaInterPointerAppDef_oaFrameObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFrame_get_doc[] =
"Class: oaInterPointerAppDef_oaFrame, Function: get\n"
" Paramegers: (oaFrame)\n"
" Calls: oaObject* get(const oaFrame* object)\n"
" Signature: get|ptr-oaObject|cptr-oaFrame,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaFrame_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaFrame data;
int convert_status=PyoaInterPointerAppDef_oaFrame_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaFrameObject* self=(PyoaInterPointerAppDef_oaFrameObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaFrame p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaFrame_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFrame_set_doc[] =
"Class: oaInterPointerAppDef_oaFrame, Function: set\n"
" Paramegers: (oaFrame,oaObject)\n"
" Calls: void set(oaFrame* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaFrame,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaFrame_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaFrame data;
int convert_status=PyoaInterPointerAppDef_oaFrame_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaFrameObject* self=(PyoaInterPointerAppDef_oaFrameObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaFrame p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaFrame_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFrame_isNull_doc[] =
"Class: oaInterPointerAppDef_oaFrame, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaFrame_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaFrame data;
int convert_status=PyoaInterPointerAppDef_oaFrame_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaFrame_assign_doc[] =
"Class: oaInterPointerAppDef_oaFrame, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaFrame_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaFrame data;
int convert_status=PyoaInterPointerAppDef_oaFrame_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaFrame p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaFrame_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaFrame_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaFrame_get,METH_VARARGS,oaInterPointerAppDef_oaFrame_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaFrame_set,METH_VARARGS,oaInterPointerAppDef_oaFrame_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaFrame_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaFrame_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaFrame_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaFrame_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFrame_doc[] =
"Class: oaInterPointerAppDef_oaFrame\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaFrame)\n"
" Calls: (const oaInterPointerAppDef_oaFrame&)\n"
" Signature: oaInterPointerAppDef_oaFrame||cref-oaInterPointerAppDef_oaFrame,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaFrame_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaFrame",
sizeof(PyoaInterPointerAppDef_oaFrameObject),
0,
(destructor)oaInterPointerAppDef_oaFrame_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaFrame_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaFrame_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaFrame_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaFrame_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaFrame_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFrame_static_find_doc[] =
"Class: oaInterPointerAppDef_oaFrame, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaFrame* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaFrame|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaFrame* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaFrame|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaFrame_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaFramep result= (oaInterPointerAppDef_oaFrame::find(p1.Data()));
return PyoaInterPointerAppDef_oaFrame_FromoaInterPointerAppDef_oaFrame(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaFramep result= (oaInterPointerAppDef_oaFrame::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaFrame_FromoaInterPointerAppDef_oaFrame(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaFrame, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFrame_static_get_doc[] =
"Class: oaInterPointerAppDef_oaFrame, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaFrame* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFrame|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaFrame* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFrame|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaFrame* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFrame|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaFrame* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFrame|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaFrame_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaFramep result= (oaInterPointerAppDef_oaFrame::get(p1.Data()));
return PyoaInterPointerAppDef_oaFrame_FromoaInterPointerAppDef_oaFrame(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaFramep result= (oaInterPointerAppDef_oaFrame::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaFrame_FromoaInterPointerAppDef_oaFrame(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaFramep result= (oaInterPointerAppDef_oaFrame::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaFrame_FromoaInterPointerAppDef_oaFrame(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaFramep result= (oaInterPointerAppDef_oaFrame::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaFrame_FromoaInterPointerAppDef_oaFrame(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaFrame, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaFrame_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaFrame_static_find,METH_VARARGS,oaInterPointerAppDef_oaFrame_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaFrame_static_get,METH_VARARGS,oaInterPointerAppDef_oaFrame_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaFrame_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaFrame_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaFrame\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaFrame",
(PyObject*)(&PyoaInterPointerAppDef_oaFrame_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaFrame\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaFrame_Type.tp_dict;
for(method=oaInterPointerAppDef_oaFrame_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
/********************************************************************
* Copyright 2002-2008 LSI Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************/
#include "pyoa_header.h"
// ==================================================================
// Wrapper Implementation for Class: oaInterPointerAppDef_oaFrameInst
// ==================================================================
// ==================================================================
// Alloc/Dealloc Routines
// ==================================================================
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaFrameInst_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
try {
int is_raw=(type==&PyoaInterPointerAppDef_oaFrameInst_Type);
PyObject* bself = type->tp_alloc(type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaFrameInstObject* self = (PyoaInterPointerAppDef_oaFrameInstObject*)bself;
self->locks = NULL;
self->borrow = 0;
static char *kwlist [] = { NULL } ;
// Case: (oaInterPointerAppDef_oaFrameInst)
{
PyParamoaInterPointerAppDef_oaFrameInst p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaFrameInst_Convert,&p1)) {
self->data=p1.Data();
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
// Case: ()
{
if (PyArg_ParseTuple(args,(char*)"")) {
self->data=NULL;
self->value=&(self->data);
return bself;
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Constructor found for class: oaInterPointerAppDef_oaFrameInst, Choices are:\n"
" (oaInterPointerAppDef_oaFrameInst)\n"
);
Py_DECREF(self);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static void
oaInterPointerAppDef_oaFrameInst_tp_dealloc(PyoaInterPointerAppDef_oaFrameInstObject* self)
{
self->ob_type->tp_free((PyObject*)self);
}
// ------------------------------------------------------------------
static PyObject*
oaInterPointerAppDef_oaFrameInst_tp_repr(PyObject *ob)
{
PyParamoaInterPointerAppDef_oaFrameInst value;
int convert_status=PyoaInterPointerAppDef_oaFrameInst_Convert(ob,&value);
assert(convert_status!=0);
PyObject* result;
char buffer[54];
sprintf(buffer,"<oaInterPointerAppDef_oaFrameInst::" DISPLAY_FORMAT ">",POINTER_AS_DISPLAY(value.DataCall()));
result=PyString_FromString(buffer);
return result;
}
// ------------------------------------------------------------------
static int
oaInterPointerAppDef_oaFrameInst_tp_compare(PyObject *ob1,PyObject* ob2)
{
PyParamoaInterPointerAppDef_oaFrameInst v1;
PyParamoaInterPointerAppDef_oaFrameInst v2;
int convert_status1=PyoaInterPointerAppDef_oaFrameInst_Convert(ob1,&v1);
int convert_status2=PyoaInterPointerAppDef_oaFrameInst_Convert(ob2,&v2);
assert(convert_status1!=0);
assert(convert_status2!=0);
if (v1.DataCall()==v2.DataCall()) return 0;
return 1;
}
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaFrameInst_Convert(PyObject* ob,PyParamoaInterPointerAppDef_oaFrameInst* result)
{
if (ob == NULL) return 1;
if (PyoaInterPointerAppDef_oaFrameInst_Check(ob)) {
result->SetData( (oaInterPointerAppDef_oaFrameInst**) ((PyoaInterPointerAppDef_oaFrameInstObject*)ob)->value);
return 1;
}
PyErr_SetString(PyExc_TypeError,
"Convertion of parameter to class: oaInterPointerAppDef_oaFrameInst Failed");
return 0;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaFrameInst_FromoaInterPointerAppDef_oaFrameInst(oaInterPointerAppDef_oaFrameInst** value,int borrow,PyObject* lock)
{
if (value && *value) {
oaInterPointerAppDef_oaFrameInst* data=*value;
PyObject* bself = PyoaInterPointerAppDef_oaFrameInst_Type.tp_alloc(&PyoaInterPointerAppDef_oaFrameInst_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaFrameInstObject* self = (PyoaInterPointerAppDef_oaFrameInstObject*)bself;
self->value = (oaObject**) value;
self->data = NULL;
self->locks = NULL;
self->borrow = 0; // Ignore borrow flag, since we copied
if (lock) PyoaLockObject(self->locks,lock);
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
PyObject* PyoaInterPointerAppDef_oaFrameInst_FromoaInterPointerAppDef_oaFrameInst(oaInterPointerAppDef_oaFrameInst* data)
{
if (data) {
PyObject* bself = PyoaInterPointerAppDef_oaFrameInst_Type.tp_alloc(&PyoaInterPointerAppDef_oaFrameInst_Type,0);
if (bself == NULL) return bself;
PyoaInterPointerAppDef_oaFrameInstObject* self = (PyoaInterPointerAppDef_oaFrameInstObject*)bself;
self->data = (oaObject*) data;
self->value = &(self->data);
self->borrow = 0;
self->locks = NULL;
return bself;
}
Py_INCREF(Py_None);
return Py_None;
}
// ------------------------------------------------------------------
// FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFrameInst_get_doc[] =
"Class: oaInterPointerAppDef_oaFrameInst, Function: get\n"
" Paramegers: (oaFrameInst)\n"
" Calls: oaObject* get(const oaFrameInst* object)\n"
" Signature: get|ptr-oaObject|cptr-oaFrameInst,\n"
" This function returns the value associated with this extension for the specified object . The value is returned as a pointer to an oaObject .\n"
" object\n"
" The object whose extension value to return\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaFrameInst_get(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaFrameInst data;
int convert_status=PyoaInterPointerAppDef_oaFrameInst_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaFrameInstObject* self=(PyoaInterPointerAppDef_oaFrameInstObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaFrameInst p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaFrameInst_Convert,&p1)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
oaObjectp result= (data.DataCall()->get(p1.Data()));
return PyoaObject_FromoaObject(result);
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFrameInst_set_doc[] =
"Class: oaInterPointerAppDef_oaFrameInst, Function: set\n"
" Paramegers: (oaFrameInst,oaObject)\n"
" Calls: void set(oaFrameInst* object,const oaObject* otherObject)\n"
" Signature: set|void-void|ptr-oaFrameInst,cptr-oaObject,\n"
" This function sets the value associated with this extension for the specified object to the specified value .\n"
" object\n"
" The object whose extension value to set\n"
" otherObject\n"
" The value to assign to the specified object\n"
" oacInvalidDesignObjectForAppDef\n"
;
static PyObject*
oaInterPointerAppDef_oaFrameInst_set(PyObject* ob, PyObject *args)
{
try {
PyParamoaInterPointerAppDef_oaFrameInst data;
int convert_status=PyoaInterPointerAppDef_oaFrameInst_Convert(ob,&data);
assert(convert_status!=0);
PyoaInterPointerAppDef_oaFrameInstObject* self=(PyoaInterPointerAppDef_oaFrameInstObject*)ob;
if (!PyValidateDbObject(data.Data(),0)) return NULL;
PyParamoaFrameInst p1;
PyParamoaObject p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaFrameInst_Convert,&p1,
&PyoaObject_Convert,&p2)) {
if (!PyValidateDbObject(p1.Data(),1)) return NULL;
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
data.DataCall()->set(p1.Data(),p2.Data());
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFrameInst_isNull_doc[] =
"Class: oaInterPointerAppDef_oaFrameInst, Function: isNull\n"
" Parameters: () \n"
" This functions returns 1 if the DbPointer is NULL, and 0 otherwise.\n"
;
static PyObject*
oaInterPointerAppDef_oaFrameInst_tp_isNull(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaFrameInst data;
int convert_status=PyoaInterPointerAppDef_oaFrameInst_Convert(ob,&data);
assert(convert_status!=0);
if (data.DataCall()==NULL)
return PyInt_FromLong(1);
else
return PyInt_FromLong(0);
}
static char oaInterPointerAppDef_oaFrameInst_assign_doc[] =
"Class: oaInterPointerAppDef_oaFrameInst, Function: set\n"
" Paramegers: (oaDouble)\n"
" This function sets the current value.\n"
;
static PyObject*
oaInterPointerAppDef_oaFrameInst_tp_assign(PyObject* ob, PyObject *args)
{
PyParamoaInterPointerAppDef_oaFrameInst data;
int convert_status=PyoaInterPointerAppDef_oaFrameInst_Convert(ob,&data);
assert(convert_status!=0);
try {
PyParamoaInterPointerAppDef_oaFrameInst p1;
if (PyArg_ParseTuple(args,(char*)"O&",
&PyoaInterPointerAppDef_oaFrameInst_Convert,&p1)) {
data.Data()=p1.Data();
Py_INCREF(ob);
return ob;
}
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
// Function Methods Table:
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaFrameInst_methodlist[] = {
{"get",(PyCFunction)oaInterPointerAppDef_oaFrameInst_get,METH_VARARGS,oaInterPointerAppDef_oaFrameInst_get_doc},
{"set",(PyCFunction)oaInterPointerAppDef_oaFrameInst_set,METH_VARARGS,oaInterPointerAppDef_oaFrameInst_set_doc},
{"isNull",(PyCFunction)oaInterPointerAppDef_oaFrameInst_tp_isNull,METH_VARARGS,oaInterPointerAppDef_oaFrameInst_isNull_doc},
{"assign",(PyCFunction)oaInterPointerAppDef_oaFrameInst_tp_assign,METH_VARARGS,oaInterPointerAppDef_oaFrameInst_assign_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Object:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFrameInst_doc[] =
"Class: oaInterPointerAppDef_oaFrameInst\n"
" The oaInterPointerAppDef class implements an application-specific extension to a particular type of data in a database.\n"
" Once created, a database object pointer field is added to each object of the specified dataType. The default value for the object pointer is NULL. Applications can use the new field for whatever purpose is necessary.\n"
" Note: The pointer must be NULL or must point to a persistent object in the same database. The pointer must not point at objects in another database, objects not in a database, the database itself ( oaDesign or oaTech ), or utility objects.\n"
" This extension is similar to the oaIntraPointerAppDef , except that oaInterPointerAppDef supports pointers to other types of objects within the same database. If only pointers to objects of the same type are created, use oaIntraPointerAppDef , since it requires slightly less memory and is slightly faster.\n"
" For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.\n"
"Constructors:\n"
" Paramegers: (oaInterPointerAppDef_oaFrameInst)\n"
" Calls: (const oaInterPointerAppDef_oaFrameInst&)\n"
" Signature: oaInterPointerAppDef_oaFrameInst||cref-oaInterPointerAppDef_oaFrameInst,\n"
;
// ------------------------------------------------------------------
PyTypeObject PyoaInterPointerAppDef_oaFrameInst_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"oaInterPointerAppDef_oaFrameInst",
sizeof(PyoaInterPointerAppDef_oaFrameInstObject),
0,
(destructor)oaInterPointerAppDef_oaFrameInst_tp_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
(cmpfunc)oaInterPointerAppDef_oaFrameInst_tp_compare, /* tp_compare */
(reprfunc)oaInterPointerAppDef_oaFrameInst_tp_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
0, /* tp_as_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
oaInterPointerAppDef_oaFrameInst_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompre */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
oaInterPointerAppDef_oaFrameInst_methodlist, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
&PyoaAppDef_Type, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
PyType_GenericAlloc, /* tp_alloc */
oaInterPointerAppDef_oaFrameInst_new, /* tp_new */
_PyObject_Del, /* tp_free */
};
// ------------------------------------------------------------------
// Static FunctionMethods:
// ------------------------------------------------------------------
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFrameInst_static_find_doc[] =
"Class: oaInterPointerAppDef_oaFrameInst, Function: find\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaFrameInst* find(const oaString& name)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaFrameInst|cref-oaString,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' if it exists.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaFrameInst* find(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: find|ptr-oaInterPointerAppDef_oaFrameInst|cref-oaString,cptr-oaAppObjectDef,\n"
" This function returns an oaInterPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.\n"
" name\n"
" The name of the oaAppDef object to look for\n"
" objDef\n"
" A constant pointer to the object extension\n"
;
static PyObject*
oaInterPointerAppDef_oaFrameInst_static_find(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaFrameInstp result= (oaInterPointerAppDef_oaFrameInst::find(p1.Data()));
return PyoaInterPointerAppDef_oaFrameInst_FromoaInterPointerAppDef_oaFrameInst(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaFrameInstp result= (oaInterPointerAppDef_oaFrameInst::find(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaFrameInst_FromoaInterPointerAppDef_oaFrameInst(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaFrameInst, function: find, Choices are:\n"
" (oaString)\n"
" (oaString,oaAppObjectDef)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static char oaInterPointerAppDef_oaFrameInst_static_get_doc[] =
"Class: oaInterPointerAppDef_oaFrameInst, Function: get\n"
" Paramegers: (oaString)\n"
" Calls: oaInterPointerAppDef_oaFrameInst* get(const oaString& name)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFrameInst|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaFrameInst* get(const oaString& name,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFrameInst|cref-oaString,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name . The name must be unique for all extension types. You can create an oaInterPointerAppDef extension on any object except another extension.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef)\n"
" Calls: oaInterPointerAppDef_oaFrameInst* get(const oaString& name,const oaAppObjectDef* objDef)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFrameInst|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
" Paramegers: (oaString,oaAppObjectDef,oaBoolean)\n"
" Calls: oaInterPointerAppDef_oaFrameInst* get(const oaString& name,const oaAppObjectDef* objDef,oaBoolean persist)\n"
" Signature: get|ptr-oaInterPointerAppDef_oaFrameInst|cref-oaString,cptr-oaAppObjectDef,simple-oaBoolean,\n"
" This function constructs an oaInterPointerAppDef with the specified name and associates it with the specified oaAppObjectDef class. The name must be unique for all extension types.\n"
" name\n"
" The name given to the oaInterPointerAppDef object\n"
" objDef\n"
" The object extension with which to associate the extension\n"
" persist\n"
" Saves the oaInterPointerAppDef data in the database\n"
" oacAppDefExists\n"
;
static PyObject*
oaInterPointerAppDef_oaFrameInst_static_get(PyObject* ob, PyObject *args)
{
try {
// Case: (oaString)
{
PyParamoaString p1;
if (PyArg_ParseTuple(args,"O&",
&PyoaString_Convert,&p1)) {
oaInterPointerAppDef_oaFrameInstp result= (oaInterPointerAppDef_oaFrameInst::get(p1.Data()));
return PyoaInterPointerAppDef_oaFrameInst_FromoaInterPointerAppDef_oaFrameInst(result);
}
}
PyErr_Clear();
// Case: (oaString,oaBoolean)
{
PyParamoaString p1;
PyParamoaBoolean p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaBoolean_Convert,&p2)) {
oaInterPointerAppDef_oaFrameInstp result= (oaInterPointerAppDef_oaFrameInst::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaFrameInst_FromoaInterPointerAppDef_oaFrameInst(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
if (PyArg_ParseTuple(args,"O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaFrameInstp result= (oaInterPointerAppDef_oaFrameInst::get(p1.Data(),p2.Data()));
return PyoaInterPointerAppDef_oaFrameInst_FromoaInterPointerAppDef_oaFrameInst(result);
}
}
PyErr_Clear();
// Case: (oaString,oaAppObjectDef,oaBoolean)
{
PyParamoaString p1;
PyParamoaAppObjectDef p2;
PyParamoaBoolean p3;
if (PyArg_ParseTuple(args,"O&O&O&",
&PyoaString_Convert,&p1,
&PyoaAppObjectDef_Convert,&p2,
&PyoaBoolean_Convert,&p3)) {
if (!PyValidateDbObject(p2.Data(),2)) return NULL;
oaInterPointerAppDef_oaFrameInstp result= (oaInterPointerAppDef_oaFrameInst::get(p1.Data(),p2.Data(),p3.Data()));
return PyoaInterPointerAppDef_oaFrameInst_FromoaInterPointerAppDef_oaFrameInst(result);
}
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"No Arg-Matching Function found for class: oaInterPointerAppDef_oaFrameInst, function: get, Choices are:\n"
" (oaString)\n"
" (oaString,oaBoolean)\n"
" (oaString,oaAppObjectDef)\n"
" (oaString,oaAppObjectDef,oaBoolean)\n"
);
return NULL;
}
catch (oaException &excp) {
PyErr_OpenAccess(excp);
return NULL;
}
}
// ------------------------------------------------------------------
static PyMethodDef oaInterPointerAppDef_oaFrameInst_staticmethodlist[] = {
{"static_find",(PyCFunction)oaInterPointerAppDef_oaFrameInst_static_find,METH_VARARGS,oaInterPointerAppDef_oaFrameInst_static_find_doc},
{"static_get",(PyCFunction)oaInterPointerAppDef_oaFrameInst_static_get,METH_VARARGS,oaInterPointerAppDef_oaFrameInst_static_get_doc},
{NULL,NULL,0,NULL}
};
// ------------------------------------------------------------------
// Type Init:
// ------------------------------------------------------------------
int
PyoaInterPointerAppDef_oaFrameInst_TypeInit(PyObject* mod_dict)
{
if (PyType_Ready(&PyoaInterPointerAppDef_oaFrameInst_Type)<0) {
printf("** PyType_Ready failed for: oaInterPointerAppDef_oaFrameInst\n");
return -1;
}
if (PyDict_SetItemString(mod_dict,"oaInterPointerAppDef_oaFrameInst",
(PyObject*)(&PyoaInterPointerAppDef_oaFrameInst_Type))<0) {
printf("** Failed to add type name to module dictionary for: oaInterPointerAppDef_oaFrameInst\n");
return -1;
}
PyObject *dict, *value;
PyMethodDef *method;
dict=PyoaInterPointerAppDef_oaFrameInst_Type.tp_dict;
for(method=oaInterPointerAppDef_oaFrameInst_staticmethodlist;method->ml_name!=NULL;method++) {
value=PyCFunction_New(method,NULL);
if (value==NULL) return -1;
if (PyDict_SetItemString(dict,method->ml_name,value)!=0) {
Py_DECREF(value);
printf("** Failed to add static function to module dictionary for: %s\n",
method->ml_name);
return -1;
}
Py_DECREF(value);
}
return 0;
}
| [
"henrik@arcturus.(none)"
] | [
[
[
1,
29135
]
]
] |
b025c386ccf3403542dc25f030a9fd5ebe1e1363 | c7120eeec717341240624c7b8a731553494ef439 | /src/cplusplus/freezone-samp/src/core/time_count_blocker.hpp | 947f4af0ce3a5d1ca877c63f9d95f5b3ee205b3e | [] | no_license | neverm1ndo/gta-paradise-sa | d564c1ed661090336621af1dfd04879a9c7db62d | 730a89eaa6e8e4afc3395744227527748048c46d | refs/heads/master | 2020-04-27T22:00:22.221323 | 2010-09-04T19:02:28 | 2010-09-04T19:02:28 | 174,719,907 | 1 | 0 | null | 2019-03-09T16:44:43 | 2019-03-09T16:44:43 | null | UTF-8 | C++ | false | false | 4,229 | hpp | #ifndef TIME_COUNT_BLOCKER_HPP
#define TIME_COUNT_BLOCKER_HPP
#include <istream>
#include <ostream>
#include <string>
#include "core/time_outs.hpp"
struct time_count_blocker_params {
time_base::millisecond_t time_interval;
unsigned int attemp_count;
unsigned int critical_attemp_count;
time_base::millisecond_t penalty;
time_base::millisecond_t critical_penalty;
time_count_blocker_params(): time_interval(60000), attemp_count(1000), critical_attemp_count(1000), penalty(0), critical_penalty(0) {}
inline void set(time_base::millisecond_t time_interval_new, unsigned int attemp_count_new, unsigned int critical_attemp_count_new, time_base::millisecond_t penalty_new, time_base::millisecond_t critical_penalty_new) {
time_interval = time_interval_new;
attemp_count = attemp_count_new;
critical_attemp_count = critical_attemp_count_new;
penalty = penalty_new;
critical_penalty = critical_penalty_new;
}
};
template <class char_t, class traits_t>
inline std::basic_istream<char_t, traits_t>& operator>>(std::basic_istream<char_t, traits_t>& is, time_count_blocker_params& params) {
return is>>params.time_interval>>params.attemp_count>>params.critical_attemp_count>>params.penalty>>params.critical_penalty;
}
template <class char_t, class traits_t>
inline std::basic_ostream<char_t, traits_t>& operator<<(std::basic_ostream<char_t, traits_t>& os, time_count_blocker_params const& params_t) {
return os<<params_t.time_interval<<" "<<params_t.attemp_count<<" "<<params_t.critical_attemp_count<<" "<<params_t.penalty<<" "<<params_t.critical_penalty;
}
#include "core/serialization/is_streameble.hpp"
namespace serialization {
template <> struct is_streameble_read <time_count_blocker_params>: std::tr1::true_type {};
template <> struct is_streameble_write<time_count_blocker_params>: std::tr1::true_type {};
} // namespace serialization {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template <typename key_t>
class time_count_blocker {
public:
time_count_blocker() {}
inline time_count_blocker_params& get_params() {return params;}
inline void increase(key_t const& key);
inline bool is_blocked(key_t const& key) const;
inline bool is_critical_blocked(key_t const& key) const;
inline time_base::millisecond_t get_time_out(key_t const& key) const;
inline void erase(key_t const& key);
inline void erase_timeouts();
private:
time_count_blocker_params params;
time_outs<key_t, unsigned int> items;
};
template <typename key_t> void time_count_blocker<key_t>::increase(key_t const& key) {
items.set_time_out(params.time_interval);
if (items.is_exist(key)) {
++items.get(key);
if (is_critical_blocked(key)) {
items.change_last_update(key, params.critical_penalty);
}
else if (is_blocked(key)) {
items.change_last_update(key, params.penalty);
}
}
else {
items.insert(key, 1);
}
}
template <typename key_t> bool time_count_blocker<key_t>::is_blocked(key_t const& key) const {
if (items.is_exist(key)) {
if (items.get(key) >= params.attemp_count) {
return true;
}
}
return false;
}
template <typename key_t> bool time_count_blocker<key_t>::is_critical_blocked(key_t const& key) const {
if (items.is_exist(key)) {
if (items.get(key) >= params.critical_attemp_count) {
return true;
}
}
return false;
}
template <typename key_t> time_base::millisecond_t time_count_blocker<key_t>::get_time_out(key_t const& key) const {
if (items.is_exist(key)) {
return items.get_time_out(key);
}
return 0;
}
template <typename key_t> void time_count_blocker<key_t>::erase(key_t const& key) {
items.erase(key);
}
template <typename key_t> void time_count_blocker<key_t>::erase_timeouts() {
items.set_time_out(params.time_interval);
items.erase_timeouts();
}
#endif // TIME_COUNT_BLOCKER_HPP
| [
"dimonml@19848965-7475-ded4-60a4-26152d85fbc5"
] | [
[
[
1,
109
]
]
] |
b7ff210281e279582976937f5b632c4571e6e57e | cfa6cdfaba310a2fd5f89326690b5c48c6872a2a | /Sources/Server/M-Server/Sources/Manager/DialogMgr.cpp | f92148d411114ad3363ed5ec1ca7719fdf249ea2 | [] | no_license | asdlei00/project-jb | 1cc70130020a5904e0e6a46ace8944a431a358f6 | 0bfaa84ddab946c90245f539c1e7c2e75f65a5c0 | refs/heads/master | 2020-05-07T21:41:16.420207 | 2009-09-12T03:40:17 | 2009-09-12T03:40:17 | 40,292,178 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 307 | cpp | #include "stdafx.h"
#include "DialogMgr.h"
CDialogMgr::CDialogMgr()
{
//m_bShowCfgDlg = false;
}
CDialogMgr::~CDialogMgr()
{
}
/*HRESULT CDialogMgr::InitDialogMgr(CMFCTabCtrl* pTab)
{
m_LogDlg.Create(CLogDlg::IDD, pTab);
m_UserDlg.Create(CUserDlg::IDD, pTab);
return S_OK;
}*/
| [
"[email protected]"
] | [
[
[
1,
20
]
]
] |
7bc6e12328d3212da7782963819d430c3c38e4d7 | 1c028f7f14916bec8ee5a686d2c7bf9abff77a8e | /cse411/PROJ3/DISK.H | ceddd8d6a653b90fff5b4fe456cd60f3b0c3da6f | [] | no_license | jasonfsmitty/psu_projects | f70a88664352f79be137d1bc429eeb23a13e0fe0 | 0a29e57dd942bf36212b6c054331b5c728e0b6a8 | refs/heads/master | 2021-01-19T13:32:59.539871 | 2009-07-09T02:20:30 | 2009-07-09T02:20:30 | 232,685 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 590 | h | //---------------------------------------------------------------------------
// Class disk - the disk simulator
//
//---------------------------------------------------------------------------
#ifndef DISK_H
#define DISK_H
#define SECTORS 40
#define TRACKS 9
#define SECTORSIZE 512
class disk
{
public :
disk () ;
~disk () ;
int disk_read ( int track_number , int sector_number , char *buf ) ;
int disk_write ( int track_number , int sector_number , char *buf ) ;
private :
int diskfile ;
int num_track , num_sector ;
} ;
#endif
| [
"jasmith@bumblebee.(none)"
] | [
[
[
1,
30
]
]
] |
7c33e9c791ed3aee2cc67fc77035ad57c6de2f7c | f78d9c67f1785c436050d3c1ca40bf4253501717 | /Deco.cpp | b11f8bac11bbc7b0ac7d97de4f13ac205d70c643 | [] | no_license | elcerdo/pixelcity | 0cdafbd013994475cd1db5919807f4e537d58b4c | aafecd6bd344ec79298d8aaf0c08426934fc2049 | refs/heads/master | 2021-01-10T22:06:18.964202 | 2009-05-13T19:15:40 | 2009-05-13T19:15:40 | 194,478 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 8,630 | cpp | /*-----------------------------------------------------------------------------
Deco.cpp
2009 Shamus Young
-------------------------------------------------------------------------------
This handles building and rendering decoration objects - infrastructure &
such around the city.
-----------------------------------------------------------------------------*/
#define LOGO_OFFSET 0.2f //How far a logo sticks out from the given surface
#include <cmath>
#include <GL/gl.h>
#include <GL/glu.h>
#include "glTypes.h"
#include "Deco.h"
#include "Light.h"
#include "Mesh.h"
#include "Macro.h"
#include "Math.h"
#include "Random.h"
#include "Render.h"
#include "Texture.h"
#include "World.h"
#include "Visible.h"
/*-----------------------------------------------------------------------------
-----------------------------------------------------------------------------*/
CDeco::~CDeco ()
{
delete _mesh;
}
/*-----------------------------------------------------------------------------
-----------------------------------------------------------------------------*/
CDeco::CDeco ()
{
_mesh = new CMesh ();
_use_alpha = false;
}
/*-----------------------------------------------------------------------------
-----------------------------------------------------------------------------*/
void CDeco::Render ()
{
glColor3fv (&_color.red);
_mesh->Render ();
}
/*-----------------------------------------------------------------------------
-----------------------------------------------------------------------------*/
void CDeco::RenderFlat (bool colored)
{
}
/*-----------------------------------------------------------------------------
-----------------------------------------------------------------------------*/
bool CDeco::Alpha ()
{
return _use_alpha;
}
/*-----------------------------------------------------------------------------
-----------------------------------------------------------------------------*/
int CDeco::PolyCount ()
{
return _mesh->PolyCount ();
}
/*-----------------------------------------------------------------------------
-----------------------------------------------------------------------------*/
unsigned CDeco::Texture ()
{
return _texture;
}
/*-----------------------------------------------------------------------------
-----------------------------------------------------------------------------*/
void CDeco::CreateRadioTower (GLvector pos, float height)
{
CLight* l;
float offset;
GLvertex v;
int index_list[] = {0,1,2,3,4,5};
offset = height / 15.0f;
_center = pos;
_use_alpha = true;
//Radio tower
v.position = glVector (_center.x, _center.y + height, _center.z); v.uv = glVector (0,1);
_mesh->VertexAdd (v);
v.position = glVector (_center.x - offset, _center.y, _center.z - offset); v.uv = glVector (1,0);
_mesh->VertexAdd (v);
v.position = glVector (_center.x + offset, _center.y, _center.z - offset); v.uv = glVector (0,0);
_mesh->VertexAdd (v);
v.position = glVector (_center.x + offset, _center.y, _center.z + offset); v.uv = glVector (1,0);
_mesh->VertexAdd (v);
v.position = glVector (_center.x - offset, _center.y, _center.z + offset); v.uv = glVector (0,0);
_mesh->VertexAdd (v);
v.position = glVector (_center.x - offset, _center.y, _center.z - offset); v.uv = glVector (1,0);
_mesh->VertexAdd (v);
_mesh->FanAdd (&index_list[0], 6);
l = new CLight (glVector (_center.x, _center.y + height + 1.0f, _center.z), glRgba (255,192,160), 1);
l->Blink ();
_texture = TextureId (TEXTURE_LATTICE);
}
/*-----------------------------------------------------------------------------
-----------------------------------------------------------------------------*/
void CDeco::CreateLogo (GLvector2 start, GLvector2 end, float bottom, int seed, GLrgba color)
{
GLvertex p;
int index_list[] = {0,1,3,2};
float u1, u2, v1, v2;
float top;
float height, length;
GLvector2 center2d;
GLvector to;
GLvector out;
int logo_index;
_use_alpha = true;
_color = color;
logo_index = seed % LOGO_ROWS;
to = glVector (start.x, 0.0f, start.y) - glVector (end.x, 0.0f, end.y);
to = glVectorNormalize (to);
out = glVectorCrossProduct (glVector (0.0f, 1.0f, 0.0f), to) * LOGO_OFFSET;
center2d = (start + end) / 2;
_center = glVector (center2d.x, bottom, center2d.y);
length = glVectorLength (start - end);
height = (length / 8.0f) * 1.5f;
top = bottom + height;
u1 = 0.0f;
u2 = 0.5f;//We actually only use the left half of the texture
v1 = (float)logo_index / LOGO_ROWS;
v2 = v1 + (1.0f / LOGO_ROWS);
p.position = glVector (start.x, bottom, start.y) + out; p.uv = glVector (u1,v1);
_mesh->VertexAdd (p);
p.position = glVector (end.x, bottom, end.y) + out; p.uv = glVector (u2, v1);
_mesh->VertexAdd (p);
p.position = glVector (end.x, top, end.y) + out; p.uv = glVector (u2, v2);
_mesh->VertexAdd (p);
p.position = glVector (start.x, top, start.y) + out; p.uv = glVector (u1, v2);
_mesh->VertexAdd (p);
_mesh->QuadStripAdd (&index_list[0], 4);
_texture = TextureId (TEXTURE_LOGOS);
}
/*-----------------------------------------------------------------------------
-----------------------------------------------------------------------------*/
void CDeco::CreateLightStrip (float x, float z, float width, float depth, float height, GLrgba color)
{
GLvertex p;
int index_list1[] = {0,1,3,2};
int index_list2[] = {4,5,7,6};
float u, v;
_color = color;
_use_alpha = true;
_center = glVector (x + width / 2, height, z + depth / 2);
if (width < depth) {
u = 1.0f;
v = (float)((int)(depth / width));
} else {
v = 1.0f;
u = (float)((int)(width / depth));
}
//u = MAX (width, 1);
//v = MAX (depth, 1);
_texture = TextureId (TEXTURE_LIGHT);
p.position = glVector (x, height, z); p.uv = glVector (0.0f, 0.0f);
_mesh->VertexAdd (p);
p.position = glVector (x, height, z + depth); p.uv = glVector (0.0f, v);
_mesh->VertexAdd (p);
p.position = glVector (x + width, height, z + depth); p.uv = glVector (u, v);
_mesh->VertexAdd (p);
p.position = glVector (x + width, height, z); p.uv = glVector (u, 0.0f);
_mesh->VertexAdd (p);
p.position = glVector (x - 1, height, z - 1); p.uv = glVector (0, 0);
_mesh->VertexAdd (p);
p.position = glVector (x - 1, height, z + depth + 1); p.uv = glVector (0, 1);
_mesh->VertexAdd (p);
p.position = glVector (x + width + 1, height, z + depth + 1); p.uv = glVector (1, 1);
_mesh->VertexAdd (p);
p.position = glVector (x + width + 1, height, z - 1); p.uv = glVector (1, 0);
_mesh->VertexAdd (p);
_mesh->QuadStripAdd (&index_list1[0], 4);
//_mesh->QuadStripAdd (&index_list2[0], 4);
_mesh->Compile ();
}
/*-----------------------------------------------------------------------------
-----------------------------------------------------------------------------*/
void CDeco::CreateLightTrim (GLvector* chain, int count, float height, int seed, GLrgba color)
{
GLvertex p;
GLvector to;
GLvector out;
int i;
int index;
int prev, next;
float u, v1, v2;
float row;
int* index_list;
_color = color;
_center = glVector (0.0f, 0.0f, 0.0f);
index_list = new int[count * 2 + 2];
for (i = 0; i < count; i++)
_center += chain[i];
_center /= (float)count;
row = (float)(seed % TRIM_ROWS);
v1 = row * TRIM_SIZE;
v2 = (row + 1.0f) * TRIM_SIZE;
index = 0;
u = 0.0f;
for (i = 0; i < count + 1; i++) {
if (i)
u += glVectorLength (chain[i % count] - p.position) * 0.1f;
//Add the bottom point
prev = i - 1;
if (prev < 0)
prev = count + prev;
next = (i + 1) % count;
to = glVectorNormalize (chain[next] - chain[prev]);
out = glVectorCrossProduct (glVector (0.0f, 1.0f, 0.0f), to) * LOGO_OFFSET;
p.position = chain[i % count] + out; p.uv = glVector (u, v2);
_mesh->VertexAdd (p);
index_list[index] = index;
index++;
//Top point
p.position.y += height;p.uv = glVector (u, v1);
_mesh->VertexAdd (p);
index_list[index] = index;
index++;
}
_mesh->QuadStripAdd (index_list, index);
delete index_list;
_texture = TextureId (TEXTURE_TRIM);
_mesh->Compile ();
}
| [
"youngshamus@c6164f88-37c5-11de-9d05-31133e6853b1",
"[email protected]"
] | [
[
[
1,
15
],
[
19,
19
],
[
31,
294
]
],
[
[
16,
18
],
[
20,
30
],
[
295,
295
]
]
] |
96a7120b33eb9648635458804dc501471fbc34a3 | 6712f8313dd77ae820aaf400a5836a36af003075 | /progFlash.cpp | 35a3edada55e3ef4346a9f0bdfde741661f7aa32 | [] | no_license | AdamTT1/bdScript | d83c7c63c2c992e516dca118cfeb34af65955c14 | 5483f239935ec02ad082666021077cbc74d1790c | refs/heads/master | 2021-12-02T22:57:35.846198 | 2010-08-08T22:32:02 | 2010-08-08T22:32:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,289 | cpp | #include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <time.h>
#include <sys/mount.h>
#include <linux/mtd/mtd.h>
#include <syscall.h>
#include <signal.h>
#define __NR_myIoctl __NR_ioctl
#define __NR_myOpen __NR_open
#define __NR_myClose __NR_close
#define __NR_mySignal __NR_signal
extern int errno ;
_syscall3( int,reboot, int, param1, int,param2, int,param3 );
_syscall3( int,write, int, fd, void const *, data, unsigned, dataBytes );
_syscall3( int,read, int, fd, void *, data, unsigned, dataBytes );
_syscall3( int,myIoctl, int, fd, int, cmd, unsigned long, arg );
_syscall2( int,myOpen, char const *, filename, unsigned, mode );
_syscall1( int,myClose, int, fd );
_syscall2( int,mySignal, int, signo, void *, action );
_syscall2( int,setpgid, int, pid, int, pgid );
//
// These routines are here to reduce the dependence on glibc
// (which is in the process of being reprogrammed)
//
static int myPrint( char const *msg )
{
unsigned len = 0 ;
char const *next = msg ;
while( *next++ )
len++ ;
return write(1, msg, len );
}
static char const hexCharSet[] = { '0','1','2','3', '4','5','6','7', '8','9','A','B', 'C','D','E','F' };
static void myPrintHex( unsigned long v )
{
unsigned char const *bytes = (unsigned char const *)&v ;
unsigned i ;
for( i = 0 ; i < 4 ; i++ )
{
unsigned char const nextByte = bytes[3-i];
if( nextByte || ( 3 == i ) )
{
unsigned char const highNib = nextByte >> 4 ;
unsigned char const lowNib = nextByte & 0x0F ;
write( 1, hexCharSet+highNib, 1 );
write( 1, hexCharSet+lowNib, 1 );
}
}
}
static void doReboot()
{
reboot( (int) 0xfee1dead, 672274793, 0x89abcdef ); // allows <Ctrl-Alt-Del>
reboot( (int) 0xfee1dead, 672274793, 0x1234567 ); // doesn't
}
static int myRead( unsigned int fd, unsigned char buf[], unsigned bufSize )
{
return read( fd, buf, bufSize );
}
static int myWrite( unsigned int fd, unsigned char const buf[], unsigned bufSize )
{
return write( fd, buf, bufSize );
}
int mtdErase( int Fd )
{
mtd_info_t meminfo;
mySignal(SIGTERM,SIG_IGN);
mySignal(SIGHUP,SIG_IGN);
setpgid( 0, 0 );
if (myIoctl(Fd,MEMGETINFO,(unsigned long)&meminfo) == 0)
{
erase_info_t erase;
int count ;
myPrint( "flags 0x" ); myPrintHex( meminfo.flags ); myPrint( "\r\n" );
myPrint( "size 0x" ); myPrintHex( meminfo.size ); myPrint( "\r\n" );
myPrint( "erasesize 0x" ); myPrintHex( meminfo.erasesize ); myPrint( "\r\n" );
myPrint( "oobblock 0x" ); myPrintHex( meminfo.oobblock ); myPrint( "\r\n" );
myPrint( "oobsize 0x" ); myPrintHex( meminfo.oobsize ); myPrint( "\r\n" );
myPrint( "ecctype 0x" ); myPrintHex( meminfo.ecctype ); myPrint( "\r\n" );
myPrint( "eccsize 0x" ); myPrintHex( meminfo.eccsize ); myPrint( "\r\n" );
count = meminfo.size / meminfo.erasesize ;
erase.start = 0 ;
erase.length = meminfo.erasesize;
for (; count > 0; count--) {
myPrint("\rPerforming Flash Erase of length 0x" );
myPrintHex( erase.length );
myPrint(" at offset 0x" );
myPrintHex( erase.start );
if (myIoctl(Fd,MEMERASE,(unsigned long)&erase) != 0)
{
myPrint( "\r\nMTD Erase failure");
return 8;
}
erase.start += meminfo.erasesize;
}
myPrint(" done\n");
}
return 0;
}
int main(int argc,char **argv, char **envp)
{
int regcount;
int devFd;
int fileFd ;
int res = 0;
int arg ;
if (2 >= argc)
{
myPrint( "usage: progFlash device fileName [reboot]\n");
return 16;
}
// Open the device
if ((devFd = myOpen( argv[1], O_RDWR)) < 0)
{
myPrint( argv[1] ); myPrint( ":File open error\r\n");
return 8;
}
// Open the content file
if ((fileFd = myOpen( argv[2], O_RDONLY)) < 0)
{
myPrint( argv[2] ); myPrint( ":File open error\r\n");
myClose( devFd );
return 8;
}
res = mtdErase(devFd);
if( 0 == res )
{
unsigned char dataBuf[8192];
int numRead ;
myPrint( argv[1] );
myPrint( " erased successfully\n" );
while( 0 < ( numRead = myRead( fileFd, dataBuf, sizeof( dataBuf ) ) ) )
{
int numWritten ;
numWritten = myWrite( devFd, dataBuf, numRead );
if( numWritten == numRead )
{
myPrint( "." );
}
else
{
myPrint( "read 0x" ); myPrintHex( numRead ); myPrint( " bytes, wrote 0x" );
myPrintHex( numWritten ); myPrint( "\r\n" );
}
}
myPrint( "\r\n" );
}
else
myPrint( "!!!!! erase error\n" );
myClose( fileFd );
myClose( devFd );
if( 3 < argc )
doReboot();
return res;
}
| [
"ericn"
] | [
[
[
1,
185
]
]
] |
cec6d59b27ef57021d15a22b406b0e53ac9323cb | 6f2d9e6d1f0dcb3a00f2885e99a0f566571034c8 | /server/src/serialPort.h | 245f1be7c49e2362b7a54a8342df5ab6c34445ec | [] | no_license | crawford/HoIP | bfd7547bd64fe0739e706fcdce4e5b1d6a5ce796 | 3c14f29375431aad7688444fa1f88201093b398b | refs/heads/master | 2021-01-21T22:29:37.296440 | 2010-09-04T21:27:59 | 2010-09-04T21:27:59 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 337 | h | #ifndef SERIALPORT_H_
#define SERIALPORT_H_
#include <windows.h>
#include <QString>
#include <QByteArray>
class SerialPort {
public:
SerialPort(QString name);
bool config(int baudRate, int byteSize);
bool open();
bool write(QByteArray data);
void close();
private:
HANDLE hCom;
QString portName;
};
#endif
| [
"[email protected]"
] | [
[
[
1,
20
]
]
] |
47bd5ae6bf674f1d2ba2ac21d5d8b2a101e1ff3e | d64ed1f7018aac768ddbd04c5b465c860a6e75fa | /FreePcb.cpp | 484731af50d29c4ea37247af27f4e53f94b834a9 | [] | no_license | roc2/archive-freepcb-codeproject | 68aac46d19ac27f9b726ea7246cfc3a4190a0136 | cbd96cd2dc81a86e1df57b86ce540cf7c120c282 | refs/heads/master | 2020-03-25T00:04:22.712387 | 2009-06-13T04:36:32 | 2009-06-13T04:36:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,875 | cpp | // FreePcb.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "freepcb.h"
#include "resource.h"
#include "DlgShortcuts.h"
#include "afxwin.h"
//#include "QAFDebug.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFreePcbApp
BEGIN_MESSAGE_MAP(CFreePcbApp, CWinApp)
//{{AFX_MSG_MAP(CFreePcbApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
ON_COMMAND(ID_VIEW_FOOTPRINT, OnViewFootprint)
ON_COMMAND(ID_VIEW_PCB_EDITOR, OnViewPcbEditor)
ON_COMMAND(ID_FILE_OPENFOOTPRINTEDITOR, OnViewFootprint)
ON_COMMAND(ID_HELP_GOTOWEBSITE, OnHelpGotoWebsite)
ON_COMMAND(ID_FILE_MRU_FILE1, OnFileMruFile1)
ON_COMMAND(ID_FILE_MRU_FILE2, OnFileMruFile2)
ON_COMMAND(ID_FILE_MRU_FILE3, OnFileMruFile3)
ON_COMMAND(ID_FILE_MRU_FILE4, OnFileMruFile4)
ON_COMMAND(ID_HELP_KEYBOARDSHORTCUTS, OnHelpKeyboardshortcuts)
ON_COMMAND(ID_TOOLS_OPENONLINEAUTOROUTER, OnToolsOpenOnlineAutorouter)
ON_COMMAND(ID_HELP_FREEROUTINGWEBSITE, OnHelpFreeRoutingWebsite)
ON_COMMAND(ID_HELP_USERGUIDE_PDF, OnHelpUserGuidePdf)
ON_COMMAND(ID_HELP_FPCROUTE, OnHelpFpcRoute)
ON_COMMAND(ID_HELP_USERGUIDESUPPLEMENT_PDF, OnHelpUserGuideSupplementPdf)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFreePcbApp construction
CFreePcbApp::CFreePcbApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CFreePcbApp object
CFreePcbApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CFreePcbApp initialization
BOOL CFreePcbApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
ENABLE_3D_CONTROLS();
// Change the registry key under which our settings are stored.
SetRegistryKey(_T("eebit"));
CWinApp::LoadStdProfileSettings(); // Load standard INI file options (including MRU)
if( CWinApp::m_pRecentFileList == NULL)
{
AfxMessageBox( "NOTE: The recent file list is disabled on your system.\nUse the system policy editor to re-enable." );
}
EnableShellOpen();
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
m_pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CFreePcbDoc),
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CFreePcbView));
AddDocTemplate(m_pDocTemplate);
// load menus
VERIFY( m_main.LoadMenu( IDR_MAINFRAME ) );
VERIFY( m_main_drag.LoadMenu( IDR_MAINFRAME_DRAG ) );
VERIFY( m_foot.LoadMenu( IDR_FOOTPRINT ) );
VERIFY( m_foot_drag.LoadMenu( IDR_FOOTPRINT_DRAG ) );
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The window has been initialized, so show and update it.
UINT iShowCmd = GetProfileInt(_T("Settings"),_T("ShowCmd"),SW_SHOW);
m_pMainWnd->ShowWindow(iShowCmd);
m_pMainWnd->UpdateWindow();
// set pointers to document and view
CMainFrame * pMainWnd = (CMainFrame*)AfxGetMainWnd();
m_Doc = (CFreePcbDoc*)pMainWnd->GetActiveDocument();
m_View = (CFreePcbView*)pMainWnd->GetActiveView();
m_View->InitInstance();
// set initial view mode
m_view_mode = PCB;
m_Doc->InitializeNewProject();
if( cmdInfo.m_nShellCommand == CCommandLineInfo::FileOpen )
{
CString fn = cmdInfo.m_strFileName;
m_Doc->OnFileAutoOpen( fn );
}
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
CEdit m_edit_build;
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
DDX_Control(pDX, IDC_EDIT1, m_edit_build);
if( !pDX->m_bSaveAndValidate )
{
// incoming
#ifdef _DEBUG
m_edit_build.SetWindowText( "$WCREV$ Debug: ($WCDATE$)" );
#else
m_edit_build.SetWindowText( "$WCREV$ Release: ($WCDATE$)" );
#endif
}
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CFreePcbApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CFreePcbApp message handlers
void CFreePcbApp::OnViewFootprint()
{
SwitchToView( RUNTIME_CLASS( CFootprintView ) );
m_view_mode = FOOTPRINT;
return;
}
void CFreePcbApp::OnViewPcbEditor()
{
SwitchToView( RUNTIME_CLASS( CFreePcbView ) );
m_view_mode = PCB;
return;
}
// switch to a new CView
//
BOOL CFreePcbApp::SwitchToView( CRuntimeClass * pNewViewClass )
{
// I have no idea what most of this code actually does, but it seems to work
CFrameWnd * pMainWnd = (CFrameWnd*)AfxGetMainWnd();
CView * pOldActiveView = pMainWnd->GetActiveView();
if( pOldActiveView->IsKindOf( pNewViewClass ) )
return TRUE;
CView * pNewView;
if( pNewViewClass != RUNTIME_CLASS( CFreePcbView ) )
{
// switch to footprint view
CCreateContext context;
context.m_pNewViewClass = pNewViewClass;
context.m_pCurrentDoc = m_Doc;
pNewView = STATIC_DOWNCAST(CView, pMainWnd->CreateView(&context));
m_View_fp = (CFootprintView*)pNewView;
}
else
{
// switch to pcb view
pNewView = m_View;
}
if( pNewView )
{
#if 0
CMenu m_NewMenu;
if( pNewViewClass == RUNTIME_CLASS( CFreePcbView ) )
m_NewMenu.LoadMenu(IDR_MAINFRAME);
else
m_NewMenu.LoadMenu(IDR_FOOTPRINT);
ASSERT(m_NewMenu);
// Add the new menu
pMainWnd->SetMenu(&m_NewMenu);
m_NewMenu.Detach();
#endif
if( pNewViewClass == RUNTIME_CLASS( CFreePcbView ) )
pMainWnd->SetMenu(&m_main);
else
pMainWnd->SetMenu(&m_foot);
// Exchange view window IDs so RecalcLayout() works.
UINT temp = ::GetWindowLong(pOldActiveView->m_hWnd, GWL_ID);
::SetWindowLong(pOldActiveView->m_hWnd, GWL_ID, ::GetWindowLong(pNewView->m_hWnd, GWL_ID));
::SetWindowLong(pNewView->m_hWnd, GWL_ID, temp);
pNewView->ShowWindow( SW_SHOW );
pOldActiveView->ShowWindow( SW_HIDE );
pNewView->OnInitialUpdate();
pMainWnd->SetActiveView( pNewView );
pMainWnd->RecalcLayout();
if( pNewViewClass == RUNTIME_CLASS( CFreePcbView ) )
{
// switch to pcb view
// first, see if we were editing the footprint of the selected part
CShape * temp_footprint;
if( m_View->m_cursor_mode == CUR_PART_SELECTED
&& m_Doc->m_edit_footprint
&& (m_Doc->m_footprint_modified || m_Doc->m_footprint_name_changed) )
{
// yes, make a copy of the footprint from the editor
temp_footprint = new CShape;
temp_footprint->Copy( &m_View_fp->m_fp );
}
// destroy old footprint view
pOldActiveView->DestroyWindow();
if( !m_Doc->m_project_open )
{
m_Doc->m_project_modified = FALSE;
m_Doc->m_project_modified_since_autosave = FALSE;
m_Doc->OnFileClose();
}
// restore toolbar stuff
CMainFrame * frm = (CMainFrame*)AfxGetMainWnd();
frm->m_wndMyToolBar.SetLists( &m_Doc->m_visible_grid, &m_Doc->m_part_grid, &m_Doc->m_routing_grid,
m_Doc->m_visual_grid_spacing, m_Doc->m_part_grid_spacing, m_Doc->m_routing_grid_spacing,
m_Doc->m_snap_angle, m_Doc->m_units );
m_View->m_dlist->SetVisibleGrid( 1, m_Doc->m_visual_grid_spacing );
frm->SetWindowText( m_Doc->m_window_title );
m_View->ShowSelectStatus();
m_View->ShowActiveLayer();
if( m_View->m_cursor_mode == CUR_PART_SELECTED
&& m_Doc->m_edit_footprint
&& (m_Doc->m_footprint_modified || m_Doc->m_footprint_name_changed) )
{
// now offer to replace the footprint of the selected part
m_View->OnExternalChangeFootprint( temp_footprint );
delete temp_footprint;
}
m_Doc->m_edit_footprint = FALSE; // clear this flag for next time
}
else
{
// switching to footprint view, create it
int units = MIL;
m_View_fp = (CFootprintView*)pNewView;
if( m_View->m_cursor_mode == CUR_PART_SELECTED && m_Doc->m_edit_footprint )
{
m_View_fp->InitInstance( m_View->m_sel_part->shape );
units = m_View->m_sel_part->shape->m_units;
}
else
{
m_View_fp->InitInstance( NULL );
}
// restore toolbar stuff
CMainFrame * frm = (CMainFrame*)AfxGetMainWnd();
frm->m_wndMyToolBar.SetLists( &m_Doc->m_fp_visible_grid, &m_Doc->m_fp_part_grid, NULL,
m_Doc->m_fp_visual_grid_spacing, m_Doc->m_fp_part_grid_spacing, 0, m_Doc->m_fp_snap_angle, units );
m_View_fp->m_dlist->SetVisibleGrid( 1, m_Doc->m_fp_visual_grid_spacing );
}
// resize window in case it changed
CRect client_rect;
pMainWnd->GetClientRect( client_rect );
// TODO: replace these constants
client_rect.top += 24; // leave room for toolbar
client_rect.bottom -= 18; // leave room for status bar
pNewView->MoveWindow( client_rect, 1 );
return TRUE;
}
return FALSE;
}
int CFreePcbApp::ExitInstance()
{
return( CWinApp::ExitInstance() );
}
void CFreePcbApp::OnHelpGotoWebsite()
{
SHELLEXECUTEINFO ShExecInfo;
CString fn = "http://www.freepcb.com";
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = NULL;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = fn;
ShExecInfo.lpParameters = NULL;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_MAXIMIZE;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
}
void CFreePcbApp::OnFileMruFile1()
{
ASSERT( CWinApp::m_pRecentFileList );
CString str = (*CWinApp::m_pRecentFileList)[0];
m_Doc->OnFileAutoOpen( str );
return;
}
void CFreePcbApp::OnFileMruFile2()
{
ASSERT( CWinApp::m_pRecentFileList );
CString str = (*CWinApp::m_pRecentFileList)[1];
m_Doc->OnFileAutoOpen( str );
return;
}
void CFreePcbApp::OnFileMruFile3()
{
ASSERT( CWinApp::m_pRecentFileList );
CString str = (*CWinApp::m_pRecentFileList)[2];
m_Doc->OnFileAutoOpen( str );
return;
}
void CFreePcbApp::OnFileMruFile4()
{
ASSERT( CWinApp::m_pRecentFileList );
CString str = (*CWinApp::m_pRecentFileList)[3];
m_Doc->OnFileAutoOpen( str );
return;
}
BOOL CFreePcbApp::OnOpenRecentFile(UINT nID)
{
return( CWinApp::OnOpenRecentFile( nID ) );
}
CString CFreePcbApp::GetMRUFile()
{
CRecentFileList * pRecentFileList = CWinApp::m_pRecentFileList;
if( pRecentFileList == NULL )
return "";
if( pRecentFileList->GetSize() == 0 )
return "";
CString str = (*CWinApp::m_pRecentFileList)[0];
return str;
}
void CFreePcbApp::AddMRUFile( CString * str )
{
CRecentFileList * pRecentFileList = CWinApp::m_pRecentFileList;
if( m_pRecentFileList == NULL )
return;
(*CWinApp::m_pRecentFileList).Add( *str );
}
void CFreePcbApp::OnHelpKeyboardshortcuts()
{
CDlgShortcuts dlg = new CDlgShortcuts;
dlg.DoModal();
}
void CFreePcbApp::OnToolsOpenOnlineAutorouter()
{
SHELLEXECUTEINFO ShExecInfo;
CString fn = m_Doc->m_app_dir + "\\freeroute.jnlp";
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = NULL;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = fn;
ShExecInfo.lpParameters = NULL;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_MAXIMIZE;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
}
void CFreePcbApp::OnHelpFreeRoutingWebsite()
{
SHELLEXECUTEINFO ShExecInfo;
CString fn = "http://www.freerouting.net";
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = NULL;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = fn;
ShExecInfo.lpParameters = NULL;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_MAXIMIZE;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
}
void CFreePcbApp::OnHelpUserGuidePdf()
{
SHELLEXECUTEINFO ShExecInfo;
CString fn = m_Doc->m_app_dir + "\\..\\doc\\freepcb_user_guide.pdf";
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = NULL;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = fn;
ShExecInfo.lpParameters = NULL;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_MAXIMIZE;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
}
void CFreePcbApp::OnHelpUserGuideSupplementPdf()
{
SHELLEXECUTEINFO ShExecInfo;
CString fn = m_Doc->m_app_dir + "\\..\\doc\\freepcb_user_guide_supplement.pdf";
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = NULL;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = fn;
ShExecInfo.lpParameters = NULL;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_MAXIMIZE;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
}
void CFreePcbApp::OnHelpFpcRoute()
{
SHELLEXECUTEINFO ShExecInfo;
CString fn = m_Doc->m_app_dir + "\\..\\doc\\fpcroute_user_guide.pdf";
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = NULL;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = fn;
ShExecInfo.lpParameters = NULL;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_MAXIMIZE;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
}
int CFreePcbApp::DoMessageBox(LPCTSTR lpszPrompt, UINT nType, UINT nIDPrompt)
{
// show cursor
CMainFrame * frm = (CMainFrame*)AfxGetMainWnd();
::ShowCursor( TRUE );
int ret = CWinApp::DoMessageBox(lpszPrompt, nType, nIDPrompt);
::ShowCursor( FALSE );
return ret;
}
| [
"freepcb@9bfb2a70-7351-0410-8a08-c5b0c01ed314",
"jamesdily@9bfb2a70-7351-0410-8a08-c5b0c01ed314"
] | [
[
[
1,
69
],
[
71,
523
]
],
[
[
70,
70
]
]
] |
4c88af5a7d32bb2a083f04ab904b1943f8979afe | bd37f7b494990542d0d9d772368239a2d44e3b2d | /server/src/ConnectionManager.cpp | 7e973f2fa565e861359176f14ba752f56f667891 | [] | no_license | nicosuarez/pacmantaller | b559a61355517383d704f313b8c7648c8674cb4c | 0e0491538ba1f99b4420340238b09ce9a43a3ee5 | refs/heads/master | 2020-12-11T02:11:48.900544 | 2007-12-19T21:49:27 | 2007-12-19T21:49:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,430 | cpp | ///////////////////////////////////////////////////////////
// ConnectionManager.cpp
// Implementation of the Class ConnectionManager
// Created on: 21-Nov-2007 23:40:18
///////////////////////////////////////////////////////////
#include "ConnectionManager.h"
ConnectionManager* ConnectionManager::pConnectionManager = NULL;
ConnectionManager* ConnectionManager::getInstance ()
{
if (pConnectionManager == NULL)
{
pConnectionManager = new ConnectionManager();
}
return pConnectionManager;
}
/*----------------------------------------------------------------------------*/
ConnectionManager::ConnectionManager()
{
this->maxJugadores=Config::getInstance()->GetMaxJugadores();
this->minJugadores=Config::getInstance()->GetMinJugadores();
this->asignarId=0;
this->cantJugadores=0;
}
/*----------------------------------------------------------------------------*/
void ConnectionManager::agregarJugador(Jugador* jugador){
std::cout<<"Agregar Nuevo Jugador\n";
//Incrementa la cantidad de jugadores conectados.
this->cantJugadores++;
std::cout<<"Cantidad de jugadores "<<cantJugadores<<"\n";
//Se asigna un id unico al jugador
this->asignarIdJugador(jugador);
std::cout<<"Jugador nuevo id: "<<jugador->GetIdJugador()<<"\n";
//Se pone a escuchar el socket del jugador
EscucharJugador *escuchar = new EscucharJugador( jugador->GetIdJugador(), jugador->GetSocket() );
escuchar->run();
listEscuchar.push_back( escuchar );
//AgregarJugadorOp Operacion
Operacion* operacion = new AgregarJugadorOp(jugador);
//Agrego la operacion al modelo
Modelo::getInstance()->agregarOperacion(operacion);
//Validar cantidad minima de jugadores para poder jugar.
if(this->validarMinJugadores())
{
//Empezar el nivel.
std::cout<<"Empezar Nivel...\n";
Modelo::getInstance()->getEsperarMinJugadoresEvent().activar();
}
}
/*----------------------------------------------------------------------------*/
void ConnectionManager::enviarMensaje(){
}
/*----------------------------------------------------------------------------*/
ConnectionManager::~ConnectionManager()
{
tListEscuchar::iterator it;
for( it = listEscuchar.begin(); it != listEscuchar.end(); it++ )
{
(*it)->join();
delete (*it);
}
listEscuchar.clear();
}
/*----------------------------------------------------------------------------*/
Pool& ConnectionManager::GetPool(){
return pool;
}
/*----------------------------------------------------------------------------*/
void ConnectionManager::quitarJugador(int idJugador){
tListJugadores jugadores=this->pool.getJugadoresList();
itListJugadores it;
for(it=jugadores.begin();it!=jugadores.end();it++)
{
Jugador* jugador = *it;
if(jugador->GetIdJugador()==idJugador)
{
jugadores.erase(it);
}
}
}
/*----------------------------------------------------------------------------*/
Jugador* ConnectionManager::getJugador(int idJugador)
{
tListJugadores jugadores=this->pool.getJugadoresList();
itListJugadores it;
Jugador* jugador=NULL;
for(it=jugadores.begin();it!=jugadores.end();it++)
{
if((*it)->GetIdJugador()==idJugador)
{
jugador=(*it);
break;
}
}
return jugador;
}
/*----------------------------------------------------------------------------*/
bool ConnectionManager::validarMinJugadores()
{
if(this->cantJugadores < this->minJugadores)
{
return false;
}
else
{
return true;
}
}
/*----------------------------------------------------------------------------*/
bool ConnectionManager::validarMaxJugadores()
{
if(this->cantJugadores > this->maxJugadores)
{
return false;
}
else
{
return true;
}
}
/*----------------------------------------------------------------------------*/
void ConnectionManager::asignarIdJugador(Jugador* jugador)
{
//Se le asigna un id unico.
jugador->SetIdJugador(this->asignarId);
//Se incrementa el id para asignar al proximo jugador.
this->asignarId++;
}
/*----------------------------------------------------------------------------*/
void ConnectionManager::quitarEscucha( int idJugador )
{
tListEscuchar::iterator it;
for( it = this->listEscuchar.begin() ; it != this->listEscuchar.end(); it++ )
{
if( (*it)->getId() == idJugador )
{
(*it)->cancelThread();
break;
}
}
}
| [
"scamjayi@5682bcf5-5c3f-0410-a8fd-ab24993f6fe8",
"nicolas.suarez@5682bcf5-5c3f-0410-a8fd-ab24993f6fe8"
] | [
[
[
1,
40
],
[
44,
65
],
[
68,
68
],
[
71,
71
],
[
73,
142
]
],
[
[
41,
43
],
[
66,
67
],
[
69,
70
],
[
72,
72
],
[
143,
155
]
]
] |
e38c44b5bc587bd1de5d895695c3f404fbfa1340 | 00fdb9c8335382401ee0a8c06ad6ebdcaa136b40 | /ARM9/source/_console.cpp | 0cd4e061332bc65bc9db6f598f99bce64b8a02bb | [] | no_license | Mbmax/ismart-kernel | d82633ba0864f9f697c3faa4ebc093a51b8463b2 | f80d8d7156897d019eb4e16ef9cec8a431d15ed3 | refs/heads/master | 2016-09-06T13:28:25.260481 | 2011-03-29T10:31:04 | 2011-03-29T10:31:04 | 35,029,299 | 1 | 2 | null | null | null | null | GB18030 | C++ | false | false | 10,297 | cpp | /*---------------------------------------------------------------------------------
$Id: _console.cpp,v 1.1 2010/08/17 12:00:54 cpy Exp $
console code -- provides basic print functionality
Copyright (C) 2005
Michael Noland (joat)
Jason Rogers (dovoto)
Dave Murphy (WinterMute)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you use
this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
$Log: _console.cpp,v $
Revision 1.1 2010/08/17 12:00:54 cpy
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/
Revision 1.1 2009/03/30 16:04:54 administrator
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/
Revision 1.1 2009/03/30 15:26:20 administrator
最初建立的版本
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/
Revision 1.4 2005/07/14 08:00:57 wntrmute
resynchronise with ndslib
---------------------------------------------------------------------------------*/
#include <nds.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "_console.h"
#include "_const.h"
#include "memtool.h"
#include "maindef.h"
#include "disc_io.h"
#include "splash.h"
#include "shell.h"
/////////////////////////////////////////
//global console variables
#define CONSOLE_USE_COLOR255 16
#define CONSOLE_MAPWIDTH (64)
#define CONSOLE_WIDTH (256/6)
#define CONSOLE_HEIGHT (192/6)
#define TAB_SIZE 3
//map to print to
static u16* fontMap;
//location of cursor
static u8 row, col;
static volatile u32 stNullChar=0;
static bool LogOutFlag=true;
typedef struct {
u32 WriteTopSector;
u32 TopPos;
u32 BufPos;
u32 BufSize;
char *pBuf;
bool Pause;
} TLogFile;
static TLogFile LogFile;
///////////////////////////////////////////////////////////
//consoleInit
// param:
// font: 16 color font
// charBase: the location the font data will be loaded to
// numCharacters: count of characters in the font
// charStart: The ascii number of the first character in the font set
// if you have a full set this will be zero
// map: pointer to the map you will be printing to.
// pal: specifies the 16 color palette to use, if > 15 it will change all non-zero
// entries in the font to use palette index 255
/*
static void _consoleInit256(u16* font, u16* charBase, u16 numCharacters, u16* map)
{
int i;
row = col = 0;
fontMap = map;
for (i = 0; i < numCharacters * (8*8*8/16); i++){ // 8x8x8bit (16bitBus)
charBase[i] = font[i];
}
}
*/
static void _consoleInit256Packed(u8* packedfont, u16* charBase, u16 numCharacters, u16* map)
{
int i;
col=0;
row=CONSOLE_HEIGHT-1;
fontMap = map;
for (i = 0; i < numCharacters * (8*8*2/8); i++){ // 8x8x2bit (8bitBus)
u8 src=packedfont[i];
{
u16 data=0;
data|=((src>>0) & 3);
data|=((src>>2) & 3) << 8;
charBase[i*2+0]=data;
}
{
u16 data=0;
data|=((src>>4) & 3);
data|=((src>>6) & 3) << 8;
charBase[i*2+1]=data;
}
}
}
#include "_console_font_fixed6x6_packed_bin.h"
void _consoleInitDefault(u16* map, u16* charBase) {
// _consoleInit256((u16*)_console_font_fixed6x6_bin, charBase, 256, map);
_consoleInit256Packed((u8*)_console_font_fixed6x6_packed_bin, charBase, 256, map);
TLogFile *plf=&LogFile;
plf->WriteTopSector=0;
plf->TopPos=0;
plf->BufPos=0;
plf->BufSize=0;
plf->pBuf=NULL;
plf->Pause=false;
}
void _consolePrintSet(int x, int y) {
if(y < CONSOLE_HEIGHT)
row = y;
else
row = CONSOLE_HEIGHT - 1;
if(x < CONSOLE_WIDTH)
col = x;
else
col = CONSOLE_WIDTH - 1;
}
int _consoleGetPrintSetY(void)
{
return(row);
}
void _consoleClear(void)
{
// for(int i = 0; i < CONSOLE_HEIGHT * (CONSOLE_MAPWIDTH/2); i++) fontMap[i] = 0;
{
u16 *dmadst=&fontMap[0*(CONSOLE_MAPWIDTH/2)];
u16 dmasize=CONSOLE_HEIGHT*CONSOLE_MAPWIDTH;
DCache_FlushRangeOverrun((void*)dmadst,dmasize);
DMA3_SRC = (uint32)&stNullChar;
DMA3_DEST = (uint32)dmadst;
DMA3_CR = DMA_ENABLE | DMA_SRC_FIX | DMA_DST_INC | DMA_32_BIT | (dmasize>>2);
while(DMA3_CR & DMA_BUSY);
}
_consolePrintSet(0,0);
}
asm void _consolePrintChar_ScrollLine(u16 *psrc,u16 *pdst,u32 size)
{
psrc RN r0
pdst RN r1
size RN r2
PUSH {r4,r5,r6}
copy32bitx4
ldmia psrc!,{r3,r4,r5,r6}
stmia pdst!,{r3,r4,r5,r6}
subs size,size,#4*4
cmp size,#4*4
bne copy32bitx4
mov r3,#0
mov r4,#0
mov r5,#0
mov r6,#0
stmia pdst!,{r3,r4,r5,r6}
stmia pdst!,{r3,r4,r5,r6}
stmia pdst!,{r3,r4,r5,r6}
stmia pdst!,{r3,r4,r5}
POP {r4,r5,r6}
bx lr
}
static __attribute__ ((always_inline)) void _consolePrintChar(u32 c)
{
if(col >= CONSOLE_WIDTH) {
col = 0;
row++;
}
if(row >= CONSOLE_HEIGHT) {
row--;
_consolePrintChar_ScrollLine(&fontMap[1*(CONSOLE_MAPWIDTH/2)],&fontMap[0*(CONSOLE_MAPWIDTH/2)],(CONSOLE_HEIGHT-1)*CONSOLE_MAPWIDTH);
}
switch(c){
case 10: case 11: case 12: case 13: {
row++;
col = 0;
} break;
case 9: {
col += TAB_SIZE;
} break;
default: {
u32 ofs=(col/2) + (row * (CONSOLE_MAPWIDTH/2));
u16 data=fontMap[ofs];
u16 dst=(u16)c;
if((col&1)==0){
data=(data&0xff00) | (dst << 0);
}else{
data=(data&0x00ff) | (dst << 8);
}
fontMap[ofs]=data;
col++;
} break;
}
}
static bool enagba=false;
//static bool enagba=true;
#define polllimit (0x100000)
static __attribute__ ((always_inline)) void tx_waitsend(const u32 data)
{
if(enagba==false) return;
u32 poll=0;
while((*((vu8 *)0x0A000001) & 2)!=0){
poll++;
if(polllimit<poll){
enagba=false;
return;
}
}
*((vu8 *)0x0A000000)=(u8)data;
}
static __attribute__ ((always_inline)) void pcprint(const char *p)
{
if(enagba==false) return;
u32 len=strlen(p);
if(len==0) return;
if(254<len) len=254;
s32 idx=-1;
while(1){
u32 c;
idx++;
if(2<=idx){
c=p[idx-2];
}else{
if(idx==0){
c=0xa0;
}else{
c=len+1;
}
}
tx_waitsend(c);
if(c==0) break;
}
}
static void StoreLogSector(const char *s)
{
TLogFile *plf=&LogFile;
if(plf->WriteTopSector==0) return;
u32 wsidx=plf->BufPos/512;
while(*s!=0){
plf->pBuf[plf->BufPos++]=*s++;
if(plf->BufPos==plf->BufSize) plf->BufPos=plf->TopPos;
}
plf->pBuf[plf->BufPos]='!';
if(plf->Pause==false){
extern LPIO_INTERFACE active_interface;
active_interface->fn_WriteSectors(plf->WriteTopSector+wsidx,1,&plf->pBuf[wsidx*512]);
}
}
void _consolePrint(const char* s)
{
// DTCM_StackCheck(-1); // DPG儌乕僪偱偼巊偭偰偼偄偗側偄丅
pcprint(s);
StoreLogSector(s);
if(LogOutFlag==false) return;
while(*s!=0){
char c0=s[0],c1=s[1];
if(0x80<=c0){
_consolePrintChar('?');
if(c1==0) return;
s+=2;
}else{
_consolePrintChar(c0);
s+=1;
}
}
}
void _consolePrintf(const char* format, ...)
{
static char strbuf[126+1];
va_list args;
va_start( args, format );
vsnprintf( strbuf, 126, format, args );
_consolePrint(strbuf);
}
void _consoleSetLogFile(void *_pf)
{
FAT_FILE *pf=(FAT_FILE*)_pf;
TLogFile *plf=&LogFile;
u32 spc=FAT2_GetSecPerClus();
if(16<spc) spc=16;
if(FAT2_GetFileSize(pf)<(spc*512)){
_consolePrintf("Fatal error: Log file size error!!\n");
ShowLogHalt();
}
plf->WriteTopSector=FAT2_ClustToSect(pf->firstCluster);
plf->BufPos=0;
plf->BufSize=spc*512;
plf->pBuf=(char*)malloc(plf->BufSize);
plf->Pause=false;
for(u32 idx=0;idx<plf->BufSize;idx++){
plf->pBuf[idx]='-';
}
extern LPIO_INTERFACE active_interface;
active_interface->fn_WriteSectors(plf->WriteTopSector,plf->BufSize/512,plf->pBuf);
LogOutFlag=false;
_consolePrintf("Start log file. topsector=%d size=%dbyte\n",plf->WriteTopSector,plf->BufSize);
// _consolePrintf("%08x\n",data);
_consolePrintf("AppName %s %s\n%s\n%s\n",ROMTITLE,ROMVERSION,ROMDATE,ROMENV);
_consolePrintf("__current pc=0x%08x sp=0x%08x\n",__current_pc(),__current_sp());
DISCIO_ShowAdapterInfo();
plf->TopPos=plf->BufPos;
}
bool _consoleGetLogFile(void)
{
TLogFile *plf=&LogFile;
if(plf->WriteTopSector==0) return(false);
return(true);
}
void _consoleSetLogOutFlag(bool f)
{
LogOutFlag=f;
}
void _consoleLogPause(void)
{
TLogFile *plf=&LogFile;
plf->Pause=true;
}
extern void _consoleLogResume(void)
{
TLogFile *plf=&LogFile;
if(plf->Pause==false) return;
plf->Pause=false;
if(plf->WriteTopSector==0) return;
u32 wsidx=plf->BufPos/512;
u32 wscnt=plf->BufSize/512;
extern LPIO_INTERFACE active_interface;
if(wsidx==0){
active_interface->fn_WriteSectors(plf->WriteTopSector+(wscnt-1),1,&plf->pBuf[(wscnt-1)*512]);
active_interface->fn_WriteSectors(plf->WriteTopSector+wsidx,1,&plf->pBuf[wsidx*512]);
}else{
active_interface->fn_WriteSectors(plf->WriteTopSector+(wsidx-1),2,&plf->pBuf[(wsidx-1)*512]);
}
}
| [
"feng.flash@4bd7f34a-4c62-84e7-1fb2-5fbc975ebfb2"
] | [
[
[
1,
445
]
]
] |
368818fea2c46a861685f6584b39a6ef997f932e | 011359e589f99ae5fe8271962d447165e9ff7768 | /src/burn/misc/pre90s/d_skykid.cpp | c398912bcbdc627512b7344720c85d5d704efdf0 | [] | no_license | PS3emulators/fba-next-slim | 4c753375fd68863c53830bb367c61737393f9777 | d082dea48c378bddd5e2a686fe8c19beb06db8e1 | refs/heads/master | 2021-01-17T23:05:29.479865 | 2011-12-01T18:16:02 | 2011-12-01T18:16:02 | 2,899,840 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 30,325 | cpp | // FB Alpha Sky Kid driver module
// Based on MAME driver by Manuel Abadia and various others
#include "tiles_generic.h"
#include "m6809_intf.h"
#include "m6800_intf.h"
#include "namco_snd.h"
static unsigned char *AllMem;
static unsigned char *MemEnd;
static unsigned char *AllRam;
static unsigned char *RamEnd;
static unsigned char *DrvM6809ROM;
static unsigned char *DrvHD63701ROM;
static unsigned char *DrvGfxROM0;
static unsigned char *DrvGfxROM1;
static unsigned char *DrvGfxROM2;
static unsigned char *DrvColPROM;
static unsigned char *DrvHD63701RAM1;
static unsigned char *DrvHD63701RAM;
static unsigned char *DrvWavRAM;
static unsigned char *DrvVidRAM;
static unsigned char *DrvTxtRAM;
static unsigned char *DrvSprRAM;
static unsigned int *Palette;
static unsigned int *DrvPalette;
static unsigned char DrvRecalc;
static unsigned char *m6809_bank;
static unsigned char *interrupt_enable;
static unsigned char *flipscreen;
static unsigned char *priority;
static unsigned char *coin_lockout;
static unsigned short *scroll;
static unsigned char *ip_select;
static int watchdog;
static int hd63701_in_reset = 0;
static unsigned char DrvJoy1[8];
static unsigned char DrvJoy2[8];
static unsigned char DrvJoy3[8];
static unsigned char DrvJoy4[8];
static unsigned char DrvDips[3];
static unsigned char DrvReset;
static unsigned char DrvInputs[8];
static int nCyclesDone[2];
static struct BurnInputInfo SkykidInputList[] = {
{"P1 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p1 coin" },
{"P1 Start", BIT_DIGITAL, DrvJoy2 + 3, "p1 start" },
{"P1 Up", BIT_DIGITAL, DrvJoy3 + 3, "p1 up" },
{"P1 Down", BIT_DIGITAL, DrvJoy3 + 2, "p1 down" },
{"P1 Left", BIT_DIGITAL, DrvJoy3 + 0, "p1 left" },
{"P1 Right", BIT_DIGITAL, DrvJoy3 + 1, "p1 right" },
{"P1 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p1 fire 1" },
{"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 2" },
{"P2 Coin", BIT_DIGITAL, DrvJoy2 + 2, "p2 coin" },
{"P2 Start", BIT_DIGITAL, DrvJoy2 + 4, "p2 start" },
{"P2 Up", BIT_DIGITAL, DrvJoy4 + 3, "p2 up" },
{"P2 Down", BIT_DIGITAL, DrvJoy4 + 2, "p2 down" },
{"P2 Left", BIT_DIGITAL, DrvJoy4 + 0, "p2 left" },
{"P2 Right", BIT_DIGITAL, DrvJoy4 + 1, "p2 right" },
{"P2 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p2 fire 1" },
{"P2 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p2 fire 2" },
{"Reset", BIT_DIGITAL, &DrvReset, "reset" },
{"Service", BIT_DIGITAL, DrvJoy2 + 0, "service" },
{"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" },
{"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" },
{"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" },
};
STDINPUTINFO(Skykid)
static struct BurnDIPInfo SkykidDIPList[]=
{
{0x12, 0xff, 0xff, 0xff, NULL },
{0x13, 0xff, 0xff, 0xf2, NULL },
{0x14, 0xff, 0xff, 0xff, NULL },
{0 , 0xfe, 0 , 4, "Coin B" },
{0x12, 0x01, 0x03, 0x00, "3 Coins 1 Credits" },
{0x12, 0x01, 0x03, 0x01, "2 Coins 1 Credits" },
{0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" },
{0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" },
{0 , 0xfe, 0 , 2, "Freeze" },
{0x12, 0x01, 0x04, 0x04, "Off" },
{0x12, 0x01, 0x04, 0x00, "On" },
{0 , 0xfe, 0 , 2, "Round Skip" },
{0x12, 0x01, 0x08, 0x08, "Off" },
{0x12, 0x01, 0x08, 0x00, "On" },
{0 , 0xfe, 0 , 2, "Demo Sounds" },
{0x12, 0x01, 0x10, 0x00, "Off" },
{0x12, 0x01, 0x10, 0x10, "On" },
{0 , 0xfe, 0 , 4, "Coin A" },
{0x12, 0x01, 0x60, 0x00, "3 Coins 1 Credits" },
{0x12, 0x01, 0x60, 0x20, "2 Coins 1 Credits" },
{0x12, 0x01, 0x60, 0x60, "1 Coin 1 Credits" },
{0x12, 0x01, 0x60, 0x40, "1 Coin 2 Credits" },
{0 , 0xfe, 0 , 2, "Service Mode" },
{0x12, 0x01, 0x80, 0x80, "Off" },
{0x12, 0x01, 0x80, 0x00, "On" },
{0 , 0xfe, 0 , 2, "Flip Screen" },
{0x13, 0x01, 0x01, 0x00, "Off" }, // swapped
{0x13, 0x01, 0x01, 0x01, "On" },
{0 , 0xfe, 0 , 2, "Allow Buy In" },
{0x13, 0x01, 0x02, 0x00, "No" },
{0x13, 0x01, 0x02, 0x02, "Yes" },
{0 , 0xfe, 0 , 4, "Bonus Life" },
{0x13, 0x01, 0x30, 0x00, "20k every 80k" },
{0x13, 0x01, 0x30, 0x10, "20k and 80k" },
{0x13, 0x01, 0x30, 0x20, "30k every 90k" },
{0x13, 0x01, 0x30, 0x30, "30k and 90k" },
{0 , 0xfe, 0 , 4, "Lives" },
{0x13, 0x01, 0xc0, 0x80, "1" },
{0x13, 0x01, 0xc0, 0x40, "2" },
{0x13, 0x01, 0xc0, 0xc0, "3" },
{0x13, 0x01, 0xc0, 0x00, "5" },
};
STDDIPINFO(Skykid)
static struct BurnDIPInfo SkykidsDIPList[]=
{
{0x12, 0xff, 0xff, 0xff, NULL },
{0x13, 0xff, 0xff, 0xf2, NULL },
{0x14, 0xff, 0xff, 0xff, NULL },
{0 , 0xfe, 0 , 4, "Coin B" },
{0x12, 0x01, 0x03, 0x00, "3 Coins 1 Credits" },
{0x12, 0x01, 0x03, 0x01, "2 Coins 1 Credits" },
{0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" },
{0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" },
{0 , 0xfe, 0 , 2, "Freeze" },
{0x12, 0x01, 0x04, 0x04, "Off" },
{0x12, 0x01, 0x04, 0x00, "On" },
{0 , 0xfe, 0 , 2, "Round Select" },
{0x12, 0x01, 0x08, 0x00, "Off" },
{0x12, 0x01, 0x08, 0x08, "On" },
{0 , 0xfe, 0 , 2, "Demo Sounds" },
{0x12, 0x01, 0x10, 0x00, "Off" },
{0x12, 0x01, 0x10, 0x10, "On" },
{0 , 0xfe, 0 , 4, "Coin A" },
{0x12, 0x01, 0x60, 0x00, "3 Coins 1 Credits" },
{0x12, 0x01, 0x60, 0x20, "2 Coins 1 Credits" },
{0x12, 0x01, 0x60, 0x60, "1 Coin 1 Credits" },
{0x12, 0x01, 0x60, 0x40, "1 Coin 2 Credits" },
{0 , 0xfe, 0 , 2, "Service Mode" },
{0x12, 0x01, 0x80, 0x80, "Off" },
{0x12, 0x01, 0x80, 0x00, "On" },
{0 , 0xfe, 0 , 2, "Flip Screen" },
{0x13, 0x01, 0x01, 0x00, "Off" }, // swapped
{0x13, 0x01, 0x01, 0x01, "On" },
{0 , 0xfe, 0 , 2, "Allow Buy In" },
{0x13, 0x01, 0x02, 0x00, "No" },
{0x13, 0x01, 0x02, 0x02, "Yes" },
{0 , 0xfe, 0 , 4, "Bonus Life" },
{0x13, 0x01, 0x30, 0x00, "30k every 80k" },
{0x13, 0x01, 0x30, 0x10, "30k and 80k" },
{0x13, 0x01, 0x30, 0x20, "40k every 90k" },
{0x13, 0x01, 0x30, 0x30, "40k and 90k" },
{0 , 0xfe, 0 , 4, "Lives" },
{0x13, 0x01, 0xc0, 0x80, "1" },
{0x13, 0x01, 0xc0, 0x40, "2" },
{0x13, 0x01, 0xc0, 0xc0, "3" },
{0x13, 0x01, 0xc0, 0x00, "5" },
};
STDDIPINFO(Skykids)
static struct BurnDIPInfo DrgnbstrDIPList[]=
{
{0x12, 0xff, 0xff, 0xff, NULL },
{0x13, 0xff, 0xff, 0xff, NULL },
{0x14, 0xff, 0xff, 0x02, NULL },
{0 , 0xfe, 0 , 4, "Coin B" },
{0x12, 0x01, 0x03, 0x00, "3 Coins 1 Credits" },
{0x12, 0x01, 0x03, 0x01, "2 Coins 1 Credits" },
{0x12, 0x01, 0x03, 0x03, "1 Coin 1 Credits" },
{0x12, 0x01, 0x03, 0x02, "1 Coin 2 Credits" },
{0 , 0xfe, 0 , 2, "Freeze" },
{0x12, 0x01, 0x04, 0x04, "Off" },
{0x12, 0x01, 0x04, 0x00, "On" },
{0 , 0xfe, 0 , 2, "Round Skip" },
{0x12, 0x01, 0x08, 0x08, "Off" },
{0x12, 0x01, 0x08, 0x00, "On" },
{0 , 0xfe, 0 , 2, "Demo Sounds" },
{0x12, 0x01, 0x10, 0x00, "Off" },
{0x12, 0x01, 0x10, 0x10, "On" },
{0 , 0xfe, 0 , 4, "Coin A" },
{0x12, 0x01, 0x60, 0x00, "3 Coins 1 Credits" },
{0x12, 0x01, 0x60, 0x20, "2 Coins 1 Credits" },
{0x12, 0x01, 0x60, 0x60, "1 Coin 1 Credits" },
{0x12, 0x01, 0x60, 0x40, "1 Coin 2 Credits" },
{0 , 0xfe, 0 , 2, "Service Mode" },
{0x12, 0x01, 0x80, 0x80, "Off" },
{0x12, 0x01, 0x80, 0x00, "On" },
{0 , 0xfe, 0 , 2, "Allow Continue" },
{0x13, 0x01, 0x01, 0x01, "No" },
{0x13, 0x01, 0x01, 0x00, "Yes" },
{0 , 0xfe, 0 , 2, "Bonus Level" },
{0x13, 0x01, 0x02, 0x02, "Full" },
{0x13, 0x01, 0x02, 0x00, "Partial" },
{0 , 0xfe, 0 , 4, "Bonus Vitality" },
{0x13, 0x01, 0x0c, 0x00, "64" },
{0x13, 0x01, 0x0c, 0x08, "48/64" },
{0x13, 0x01, 0x0c, 0x04, "32/64" },
{0x13, 0x01, 0x0c, 0x0c, "None" },
{0 , 0xfe, 0 , 4, "Starting Vitality" },
{0x13, 0x01, 0x30, 0x00, "160" },
{0x13, 0x01, 0x30, 0x30, "128" },
{0x13, 0x01, 0x30, 0x10, "96" },
{0x13, 0x01, 0x30, 0x20, "64" },
{0 , 0xfe, 0 , 2, "Level of Monster" },
{0x13, 0x01, 0x40, 0x40, "Normal" },
{0x13, 0x01, 0x40, 0x00, "Difficult" },
{0 , 0xfe, 0 , 2, "Spurt Time" },
{0x13, 0x01, 0x80, 0x80, "Normal" },
{0x13, 0x01, 0x80, 0x00, "Difficult" },
{0 , 0xfe, 0 , 2, "Cabinet" },
{0x14, 0x01, 0x02, 0x02, "Upright" },
{0x14, 0x01, 0x02, 0x00, "Cocktail" },
};
STDDIPINFO(Drgnbstr)
static inline void sync_HD63701(int run)
{
int nNext = (int)((float)((102400.000 * nM6809CyclesTotal) / 25600));
if (nNext > 0) {
if (run) {
nCyclesDone[1] += HD63701Run(nNext - nCyclesDone[1]);
} else {
nCyclesDone[1] += nNext - nCyclesDone[1];
}
}
}
static void m6809Bankswitch(int bank)
{
bank &= 1;
if (m6809_bank[0] != bank) {
m6809_bank[0] = bank;
M6809MapMemory(DrvM6809ROM + 0x10000 + bank * 0x2000, 0x0000, 0x1fff, M6809_ROM);
}
}
void skykid_main_write(unsigned short address, unsigned char data)
{
if ((address & 0xff00) == 0x6000) {
scroll[1] = address & 0x0ff;
return;
}
if ((address & 0xfe00) == 0x6200) {
scroll[0] = address & 0x1ff;
return;
}
if ((address & 0xfc00) == 0x6800) {
namcos1_custom30_write(address & 0x3ff, data);
return;
}
if ((address & 0xf000) == 0x7000) {
int b = (~address & 0x0800) / 0x0800;
interrupt_enable[0] = b;
if (b == 0) M6809SetIRQ(0, M6809_IRQSTATUS_NONE);
return;
}
if ((address & 0xf000) == 0x8000) {
int b = (~address & 0x0800) / 0x0800;
if (b == 0) {
if (hd63701_in_reset == 0) { // sync the HD63701 and then reset it
sync_HD63701(1);
HD63701Reset();
hd63701_in_reset = 1;
}
}
else
{
if (hd63701_in_reset) { // burn cycles and then re-enable the HD63701
sync_HD63701(0);
hd63701_in_reset = 0;
}
}
return;
}
if ((address & 0xf000) == 0x9000) {
int b = (~address & 0x0800) / 0x0800;
m6809Bankswitch(b);
return;
}
if ((address & 0xfffe) == 0xa000) {
*flipscreen = address & 1;
*priority = ((data & 0xf0) == 0x50) ? 1 : 0;
return;
}
}
unsigned char skykid_main_read(unsigned short address)
{
if ((address & 0xfc00) == 0x6800) {
return namcos1_custom30_read(address & 0x3ff);
}
if ((address & 0xf800) == 0x7800) {
watchdog = 0;
return 0;
}
return 0;
}
void skykid_mcu_write(unsigned short address, unsigned char data)
{
if ((address & 0xffe0) == 0x0000) {
m6803_internal_registers_w(address & 0x1f, data);
return;
}
if ((address & 0xff80) == 0x0080) {
DrvHD63701RAM1[address & 0x7f] = data;
return;
}
if ((address & 0xfc00) == 0x1000) {
namcos1_custom30_write(address & 0x3ff, data);
return;
}
if ((address & 0xe000) == 0x2000) {
watchdog = 0;
return;
}
if ((address & 0xc000) == 0x4000) {
int b = (~address & 0x2000) / 0x2000;
interrupt_enable[1] = b;
if (b == 0) HD63701SetIRQ(0, HD63701_IRQSTATUS_NONE);
return;
}
}
unsigned char skykid_mcu_read(unsigned short address)
{
if ((address & 0xffe0) == 0x0000) {
return m6803_internal_registers_r(address & 0x1f);
}
if ((address & 0xff80) == 0x0080) {
return DrvHD63701RAM1[address & 0x7f];
}
if ((address & 0xfc00) == 0x1000) {
return namcos1_custom30_read(address & 0x3ff);
}
return 0;
}
void skykid_mcu_write_port(unsigned short port, unsigned char data)
{
switch (port & 0x1ff)
{
case HD63701_PORT1:
{
switch (data & 0xe0) {
case 0x60:
*ip_select = data & 0x07;
return;
case 0xc0:
*coin_lockout = ~data & 0x01;
// coin counters 0 -> data & 0x02, 1 -> data & 0x04
return;
}
}
return;
case HD63701_PORT2:
// led0 = data & 8, led1 = data & 0x10
return;
}
}
unsigned char skykid_mcu_read_port(unsigned short port)
{
switch (port & 0x1ff)
{
case HD63701_PORT1:
return DrvInputs[*ip_select];
case HD63701_PORT2:
return 0xff;
}
return 0;
}
static void DrvPaletteInit()
{
for (int i = 0; i < 0x100; i++) {
int r = DrvColPROM[i + 0x000] & 0x0f;
int g = DrvColPROM[i + 0x100] & 0x0f;
int b = DrvColPROM[i + 0x200] & 0x0f;
Palette[i] = (r << 20) | (r << 16) | (g << 12) | (g << 8) | (b << 4) | (b << 0);
}
for (int i = 0; i < 0x400; i++) {
Palette[i + 0x100] = Palette[DrvColPROM[0x300 + i]];
}
}
static void DrvSpriteExpand()
{
for (int i = 0; i < 0x2000; i++) {
DrvGfxROM2[0x8000 + i] = DrvGfxROM2[0x4000 + i];
DrvGfxROM2[0xa000 + i] = DrvGfxROM2[0x4000 + i] >> 4;
DrvGfxROM2[0x4000 + i] = DrvGfxROM2[0x6000 + i];
}
}
static int DrvGfxDecode()
{
int Planes[3] = { (0x8000 * 8) + 4, 0, 4 };
int XOffs0[8] = { 8*8, 8*8+1, 8*8+2, 8*8+3, 0, 1, 2, 3 };
int XOffs1[8] = { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3 };
int XOffs2[16]= { 0, 1, 2, 3, 8*8, 8*8+1, 8*8+2, 8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 24*8+0, 24*8+1, 24*8+2, 24*8+3 };
int YOffs0[16]= { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 };
int YOffs1[8] = { 0*8, 2*8, 4*8, 6*8, 8*8, 10*8, 12*8, 14*8 };
unsigned char *tmp = (unsigned char*)malloc(0x10000);
if (tmp == NULL) {
return 1;
}
memcpy (tmp, DrvGfxROM0, 0x2000);
GfxDecode(0x0200, 2, 8, 8, Planes + 1, XOffs0, YOffs0, 0x080, tmp, DrvGfxROM0);
memcpy (tmp, DrvGfxROM1, 0x2000);
GfxDecode(0x0200, 2, 8, 8, Planes + 1, XOffs1, YOffs1, 0x080, tmp, DrvGfxROM1);
memcpy (tmp, DrvGfxROM2, 0x10000);
GfxDecode(0x0200, 3, 16, 16, Planes + 0, XOffs2, YOffs0, 0x200, tmp, DrvGfxROM2);
free (tmp);
return 0;
}
static int DrvDoReset(int ClearRAM)
{
if (ClearRAM) {
memset (AllRam, 0, RamEnd - AllRam);
}
M6809Open(0);
M6809Reset();
m6809_bank[0] = ~0;
m6809Bankswitch(0);
M6809Close();
// HD63701Open(0);
HD63701Reset();
// HD63701Close();
watchdog = 0;
hd63701_in_reset = 0;
return 0;
}
static int MemIndex()
{
unsigned char *Next; Next = AllMem;
DrvM6809ROM = Next; Next += 0x014000;
DrvHD63701ROM = Next; Next += 0x010000;
DrvGfxROM0 = Next; Next += 0x010000;
DrvGfxROM1 = Next; Next += 0x010000;
DrvGfxROM2 = Next; Next += 0x030000;
DrvColPROM = Next; Next += 0x000700;
Palette = (unsigned int*)Next; Next += 0x0500 * sizeof(int);
DrvPalette = (unsigned int*)Next; Next += 0x0500 * sizeof(int);
AllRam = Next;
DrvHD63701RAM1 = Next; Next += 0x000080;
DrvHD63701RAM = Next; Next += 0x000800;
NamcoSoundProm = Next;
DrvWavRAM = Next; Next += 0x000500;
DrvVidRAM = Next; Next += 0x001000;
DrvTxtRAM = Next; Next += 0x000800;
DrvSprRAM = Next; Next += 0x001800;
m6809_bank = Next; Next += 0x000001;
interrupt_enable = Next; Next += 0x000002;
flipscreen = Next; Next += 0x000001;
priority = Next; Next += 0x000001;
coin_lockout = Next; Next += 0x000001;
ip_select = Next; Next += 0x000001;
scroll = (unsigned short*)Next; Next += 0x0002 * sizeof(short);
RamEnd = Next;
MemEnd = Next;
return 0;
}
static int DrvInit()
{
AllMem = NULL;
MemIndex();
int nLen = MemEnd - (unsigned char *)0;
if ((AllMem = (unsigned char *)malloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
{
if (BurnLoadRom(DrvM6809ROM + 0x08000, 0, 1)) return 1;
if (BurnLoadRom(DrvM6809ROM + 0x0c000, 1, 1)) return 1;
if (BurnLoadRom(DrvM6809ROM + 0x10000, 2, 1)) return 1;
if (BurnLoadRom(DrvHD63701ROM + 0x08000, 3, 1)) return 1;
if (BurnLoadRom(DrvHD63701ROM + 0x0f000, 4, 1)) return 1;
if (BurnLoadRom(DrvGfxROM0 + 0x00000, 5, 1)) return 1;
if (BurnLoadRom(DrvGfxROM1 + 0x00000, 6, 1)) return 1;
if (BurnLoadRom(DrvGfxROM2 + 0x00000, 7, 1)) return 1;
if (BurnLoadRom(DrvGfxROM2 + 0x04000, 8, 1)) return 1;
if (BurnLoadRom(DrvColPROM + 0x00000, 9, 1)) return 1;
if (BurnLoadRom(DrvColPROM + 0x00100, 10, 1)) return 1;
if (BurnLoadRom(DrvColPROM + 0x00200, 11, 1)) return 1;
if (BurnLoadRom(DrvColPROM + 0x00300, 12, 1)) return 1;
if (BurnLoadRom(DrvColPROM + 0x00500, 13, 1)) return 1;
DrvSpriteExpand();
DrvGfxDecode();
DrvPaletteInit();
}
M6809Init(1);
M6809Open(0);
M6809MapMemory(DrvM6809ROM + 0x10000, 0x0000, 0x1fff, M6809_ROM);
M6809MapMemory(DrvVidRAM, 0x2000, 0x2fff, M6809_RAM);
M6809MapMemory(DrvTxtRAM, 0x4000, 0x47ff, M6809_RAM);
M6809MapMemory(DrvSprRAM, 0x4800, 0x5fff, M6809_RAM);
M6809MapMemory(DrvM6809ROM + 0x08000, 0x8000, 0xffff, M6809_ROM);
M6809SetWriteByteHandler(skykid_main_write);
M6809SetReadByteHandler(skykid_main_read);
M6809Close();
HD63701Init(1);
// HD63701Open(0);
HD63701MapMemory(DrvHD63701ROM + 0x8000, 0x8000, 0xbfff, HD63701_ROM);
HD63701MapMemory(DrvHD63701RAM, 0xc000, 0xc7ff, HD63701_RAM);
HD63701MapMemory(DrvHD63701ROM + 0xf000, 0xf000, 0xffff, HD63701_ROM);
HD63701SetReadByteHandler(skykid_mcu_read);
HD63701SetWriteByteHandler(skykid_mcu_write);
HD63701SetReadPortHandler(skykid_mcu_read_port);
HD63701SetWritePortHandler(skykid_mcu_write_port);
// HD63701Close();
NamcoSoundInit(49152000/2048);
GenericTilesInit();
DrvDoReset(1);
return 0;
}
static int DrvExit()
{
GenericTilesExit();
NamcoSoundExit();
M6809Exit();
HD63701Exit();
free (AllMem);
AllMem = NULL;
NamcoSoundProm = NULL;
return 0;
}
static void draw_fg_layer()
{
int bank = *flipscreen ? 0x100 : 0;
for (int y = 0; y < 28; y++)
{
for (int x = 0; x < 36; x++)
{
int col = x - 2;
int row = y + 2;
int offs = 0;
if (col & 0x20) {
offs = row + ((col & 0x1f) << 5);
} else {
offs = col + (row << 5);
}
int code = DrvTxtRAM[offs + 0x000] + bank;
int color = DrvTxtRAM[offs + 0x400] & 0x3f;
if (*flipscreen) {
Render8x8Tile_Mask_Clip(pTransDraw, code, 280 - (x * 8), 216 - (y * 8), color, 2, 0, 0, DrvGfxROM0);
} else {
Render8x8Tile_Mask_Clip(pTransDraw, code, x * 8, y * 8, color, 2, 0, 0, DrvGfxROM0);
}
}
}
}
static void draw_bg_layer()
{
int scrollx, scrolly;
if (*flipscreen) {
scrollx = 189 - (scroll[0] ^ 1);
scrolly = 7 - (scroll[1] ^ 0);
} else {
scrollx = scroll[0] + 35;
scrolly = scroll[1] + 25;
}
scrollx &= 0x1ff;
scrolly &= 0x0ff;
for (int offs = 0; offs < 64 * 32; offs++)
{
int sx = (offs & 0x3f) << 3;
int sy = (offs >> 6) << 3;
sx -= scrollx;
if (sx < -7) sx += 512;
sy -= scrolly;
if (sy < -7) sy += 256;
if (sx >= nScreenWidth || sy >= nScreenHeight) continue;
int attr = DrvVidRAM[offs + 0x800];
int code = DrvVidRAM[offs + 0x000] + ((attr & 0x01) << 8);
int color = ((attr & 0x7e) >> 1) | ((attr & 0x01) << 6);
if (*flipscreen) {
Render8x8Tile_FlipXY_Clip(pTransDraw, code, 280 - sx, 216 - sy, color + (0x100 >> 2), 2, 0, DrvGfxROM1);
} else {
Render8x8Tile_Clip(pTransDraw, code, sx, sy, color + (0x100 >> 2), 2, 0, DrvGfxROM1);
}
}
}
static void draw_sprites()
{
for (int offs = 0; offs < 0x80; offs += 2)
{
int attrib = DrvSprRAM[0x1780 + offs + 0];
int sprite = DrvSprRAM[0x0780 + offs + 0] + ((attrib & 0x80) << 1);
int color =(DrvSprRAM[0x0780 + offs + 1] & 0x3f) * 8 + 0x300;
int sx =(DrvSprRAM[0x0f80 + offs + 1]) + ((DrvSprRAM[0x1780 + offs + 1] & 1) << 8) - 71;
int sy = 256 - DrvSprRAM[0x0f80 + offs + 0] - 7;
int flipx = (attrib & 0x01);
int flipy = (attrib & 0x02) >> 1;
int sizex = (attrib & 0x04) >> 2;
int sizey = (attrib & 0x08) >> 3;
sprite &= ~sizex;
sprite &= ~(sizey << 1);
if (*flipscreen)
{
flipx ^= 1;
flipy ^= 1;
}
sy -= 16 * sizey;
sy = (sy & 0xff) - 32;
for (int y = 0; y <= sizey; y++)
{
for (int x = 0; x <= sizex; x++)
{
int code = sprite + (y ^ (sizey * flipy)) * 2 + (x ^ (sizex * flipx));
RenderTileTranstab(pTransDraw, DrvGfxROM2, code, color, 0xff, sx + x * 16, sy + y * 16, flipx, flipy, 16, 16, DrvColPROM + 0x200);
}
}
}
}
static int DrvDraw()
{
if (DrvRecalc) {
for (int i = 0; i < 0x500; i++) {
int p = Palette[i];
DrvPalette[i] = BurnHighCol(p >> 16, p >> 8, p, 0);
}
DrvRecalc = 0;
}
draw_bg_layer();
if (*priority == 0) draw_sprites();
draw_fg_layer();
if (*priority == 1) draw_sprites();
BurnTransferCopy(DrvPalette);
return 0;
}
static int DrvFrame()
{
if (DrvReset) {
DrvDoReset(1);
}
watchdog++;
if (watchdog > 180) {
DrvDoReset(0);
}
{
memset (DrvInputs, 0xff, 8);
for (int i = 0; i < 8; i++) {
DrvInputs[3] ^= (DrvJoy1[i] & 1) << i;
DrvInputs[4] ^= (DrvJoy2[i] & 1) << i;
DrvInputs[5] ^= (DrvJoy4[i] & 1) << i;
DrvInputs[6] ^= (DrvJoy3[i] & 1) << i;
}
DrvInputs[0] = ((DrvDips[1] & 0xf8) >> 3);
DrvInputs[1] = ((DrvDips[1] & 0x07) << 2) | ((DrvDips[0] & 0xc0) >> 6);
DrvInputs[2] = ((DrvDips[0] & 0x3e) >> 1);
DrvInputs[3] = ((DrvInputs[3] & 0x0d) | (DrvDips[2] & 0x02)) | ((DrvDips[0] & 0x01) << 4);
if (*coin_lockout) DrvInputs[4] |= 0x03;
}
M6809NewFrame();
HD63701NewFrame();
int nInterleave = 100;
int nCyclesTotal[2] = { 1536000 / 60, 6144000 / 60 };
nCyclesDone[0] = nCyclesDone[1] = 0;
for (int i = 0; i < nInterleave; i++)
{
int nNext;
M6809Open(0);
nNext = (i + 1) * nCyclesTotal[0] / nInterleave;
nCyclesDone[0] += M6809Run(nNext - nCyclesDone[0]);
if (i == (nInterleave - 1) && interrupt_enable[0]) {
M6809SetIRQ(0, M6809_IRQSTATUS_ACK);
}
M6809Close();
// HD63701Open(0);
if (hd63701_in_reset == 0) {
sync_HD63701(1);
if (i == (nInterleave - 1) && interrupt_enable[1]) {
HD63701SetIRQ(0, M6800_IRQSTATUS_ACK);
}
} else {
sync_HD63701(0);
}
// HD63701Close();
}
if (pBurnSoundOut) {
NamcoSoundUpdate(pBurnSoundOut, nBurnSoundLen);
}
if (pBurnDraw) {
DrvDraw();
}
return 0;
}
static int DrvScan(int nAction, int *pnMin)
{
return 1; // Broken :(
struct BurnArea ba;
if (pnMin) {
*pnMin = 0x029707;
}
if (nAction & ACB_VOLATILE) {
memset(&ba, 0, sizeof(ba));
ba.Data = AllRam;
ba.nLen = RamEnd - AllRam;
ba.szName = "All Ram";
BurnAcb(&ba);
M6809Scan(nAction);
HD63701Scan(nAction);
NamcoSoundScan(nAction, pnMin);
SCAN_VAR(hd63701_in_reset);
}
if (nAction & ACB_WRITE) {
M6809Open(0);
m6809Bankswitch(m6809_bank[0]);
M6809Close();
}
return 0;
}
// Sky Kid (new version)
static struct BurnRomInfo skykidRomDesc[] = {
{ "sk2_2.6c", 0x4000, 0xea8a5822, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code
{ "sk1-1c.6b", 0x4000, 0x7abe6c6c, 1 | BRF_PRG | BRF_ESS }, // 1
{ "sk1_3.6d", 0x4000, 0x314b8765, 1 | BRF_PRG | BRF_ESS }, // 2
{ "sk2_4.3c", 0x2000, 0xa460d0e0, 2 | BRF_PRG | BRF_ESS }, // 3 HD63701 Code
{ "cus63-63a1.mcu", 0x1000, 0x6ef08fb3, 2 | BRF_PRG | BRF_ESS }, // 4
{ "sk1_6.6l", 0x2000, 0x58b731b9, 3 | BRF_GRA }, // 5 Characters
{ "sk1_5.7e", 0x2000, 0xc33a498e, 4 | BRF_GRA }, // 6 Background Tiles
{ "sk1_8.10n", 0x4000, 0x44bb7375, 5 | BRF_GRA }, // 7 Sprites
{ "sk1_7.10m", 0x4000, 0x3454671d, 5 | BRF_GRA }, // 8
{ "sk1-1.2n", 0x0100, 0x0218e726, 6 | BRF_GRA }, // 9 Color PROMs
{ "sk1-2.2p", 0x0100, 0xfc0d5b85, 6 | BRF_GRA }, // 10
{ "sk1-3.2r", 0x0100, 0xd06b620b, 6 | BRF_GRA }, // 11
{ "sk1-4.5n", 0x0200, 0xc697ac72, 6 | BRF_GRA }, // 12
{ "sk1-5.6n", 0x0200, 0x161514a4, 6 | BRF_GRA }, // 13
};
STD_ROM_PICK(skykid)
STD_ROM_FN(skykid)
struct BurnDriver BurnDrvSkykid = {
"skykid", NULL, NULL, "1985",
"Sky Kid (new version)\0", NULL, "Namco", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, skykidRomInfo, skykidRomName, SkykidInputInfo, SkykidDIPInfo,
DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc,
288, 224, 4, 3
};
// Sky Kid (old version)
static struct BurnRomInfo skykidoRomDesc[] = {
{ "sk2_2.6c", 0x4000, 0xea8a5822, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code
{ "sk1_1.6b", 0x4000, 0x070a49d4, 1 | BRF_PRG | BRF_ESS }, // 1
{ "sk1_3.6d", 0x4000, 0x314b8765, 1 | BRF_PRG | BRF_ESS }, // 2
{ "sk2_4.3c", 0x2000, 0xa460d0e0, 2 | BRF_PRG | BRF_ESS }, // 3 HD63701 Code
{ "cus63-63a1.mcu", 0x1000, 0x6ef08fb3, 2 | BRF_PRG | BRF_ESS }, // 4
{ "sk1_6.6l", 0x2000, 0x58b731b9, 3 | BRF_GRA }, // 5 Characters
{ "sk1_5.7e", 0x2000, 0xc33a498e, 4 | BRF_GRA }, // 6 Background Tiles
{ "sk1_8.10n", 0x4000, 0x44bb7375, 5 | BRF_GRA }, // 7 Sprites
{ "sk1_7.10m", 0x4000, 0x3454671d, 5 | BRF_GRA }, // 8
{ "sk1-1.2n", 0x0100, 0x0218e726, 6 | BRF_GRA }, // 9 Color PROMs
{ "sk1-2.2p", 0x0100, 0xfc0d5b85, 6 | BRF_GRA }, // 10
{ "sk1-3.2r", 0x0100, 0xd06b620b, 6 | BRF_GRA }, // 11
{ "sk1-4.5n", 0x0200, 0xc697ac72, 6 | BRF_GRA }, // 12
{ "sk1-5.6n", 0x0200, 0x161514a4, 6 | BRF_GRA }, // 13
};
STD_ROM_PICK(skykido)
STD_ROM_FN(skykido)
struct BurnDriver BurnDrvSkykido = {
"skykido", "skykid", NULL, "1985",
"Sky Kid (old version)\0", NULL, "Namco", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_MISC,
NULL, skykidoRomInfo, skykidoRomName, SkykidInputInfo, SkykidDIPInfo,
DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc,
288, 224, 4, 3
};
// Sky Kid (CUS60 version)
static struct BurnRomInfo skykiddRomDesc[] = {
{ "sk1_2.6c", 0x4000, 0x8370671a, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code
{ "sk1_1.6b", 0x4000, 0x070a49d4, 1 | BRF_PRG | BRF_ESS }, // 1
{ "sk1_3.6d", 0x4000, 0x314b8765, 1 | BRF_PRG | BRF_ESS }, // 2
{ "sk1_4.3c", 0x2000, 0x887137cc, 2 | BRF_PRG | BRF_ESS }, // 3 HD63701 Code
{ "cus60-60a1.mcu", 0x1000, 0x076ea82a, 2 | BRF_PRG | BRF_ESS }, // 4
{ "sk1_6.6l", 0x2000, 0x58b731b9, 3 | BRF_GRA }, // 5 Characters
{ "sk1_5.7e", 0x2000, 0xc33a498e, 4 | BRF_GRA }, // 6 Background Tiles
{ "sk1_8.10n", 0x4000, 0x44bb7375, 5 | BRF_GRA }, // 7 Sprites
{ "sk1_7.10m", 0x4000, 0x3454671d, 5 | BRF_GRA }, // 8
{ "sk1-1.2n", 0x0100, 0x0218e726, 6 | BRF_GRA }, // 9 Color PROMs
{ "sk1-2.2p", 0x0100, 0xfc0d5b85, 6 | BRF_GRA }, // 10
{ "sk1-3.2r", 0x0100, 0xd06b620b, 6 | BRF_GRA }, // 11
{ "sk1-4.5n", 0x0200, 0xc697ac72, 6 | BRF_GRA }, // 12
{ "sk1-5.6n", 0x0200, 0x161514a4, 6 | BRF_GRA }, // 13
};
STD_ROM_PICK(skykidd)
STD_ROM_FN(skykidd)
struct BurnDriver BurnDrvSkykidd = {
"skykidd", "skykid", NULL, "1985",
"Sky Kid (CUS60 version)\0", NULL, "Namco", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_MISC,
NULL, skykiddRomInfo, skykiddRomName, SkykidInputInfo, SkykidDIPInfo,
DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc,
288, 224, 4, 3
};
// Sky Kid (Sipem)
static struct BurnRomInfo skykidsRomDesc[] = {
{ "sk2a.6c", 0x4000, 0x68492672, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code
{ "sk1a.6b", 0x4000, 0xe16abe25, 1 | BRF_PRG | BRF_ESS }, // 1
{ "sk1_3.6d", 0x4000, 0x314b8765, 1 | BRF_PRG | BRF_ESS }, // 2
{ "sk2_4.3c", 0x2000, 0xa460d0e0, 2 | BRF_PRG | BRF_ESS }, // 3 HD63701 Code
{ "cus63-63a1.mcu", 0x1000, 0x6ef08fb3, 2 | BRF_PRG | BRF_ESS }, // 4
{ "sk1_6.6l", 0x2000, 0x58b731b9, 3 | BRF_GRA }, // 5 Characters
{ "sk1_5.7e", 0x2000, 0xc33a498e, 4 | BRF_GRA }, // 6 Background Tiles
{ "sk1_8.10n", 0x4000, 0x44bb7375, 5 | BRF_GRA }, // 7 Sprites
{ "sk1_7.10m", 0x4000, 0x3454671d, 5 | BRF_GRA }, // 8
{ "sk1-1.2n", 0x0100, 0x0218e726, 6 | BRF_GRA }, // 9 Color PROMs
{ "sk1-2.2p", 0x0100, 0xfc0d5b85, 6 | BRF_GRA }, // 10
{ "sk1-3.2r", 0x0100, 0xd06b620b, 6 | BRF_GRA }, // 11
{ "sk1-4.5n", 0x0200, 0xc697ac72, 6 | BRF_GRA }, // 12
{ "sk1-5.6n", 0x0200, 0x161514a4, 6 | BRF_GRA }, // 13
};
STD_ROM_PICK(skykids)
STD_ROM_FN(skykids)
struct BurnDriver BurnDrvSkykids = {
"skykids", "skykid", NULL, "1985",
"Sky Kid (Sipem)\0", NULL, "Namco [Sipem license]", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_MISC,
NULL, skykidsRomInfo, skykidsRomName, SkykidInputInfo, SkykidsDIPInfo,
DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc,
288, 224, 4, 3
};
// Dragon Buster
static struct BurnRomInfo drgnbstrRomDesc[] = {
{ "db1_2b.6c", 0x4000, 0x0f11cd17, 1 | BRF_PRG | BRF_ESS }, // 0 M6809 Code
{ "db1_1.6b", 0x4000, 0x1c7c1821, 1 | BRF_PRG | BRF_ESS }, // 1
{ "db1_3.6d", 0x4000, 0x6da169ae, 1 | BRF_PRG | BRF_ESS }, // 2
{ "db1_4.3c", 0x2000, 0x8a0b1fc1, 2 | BRF_PRG | BRF_ESS }, // 3 HD63701 Code
{ "cus60-60a1.mcu", 0x1000, 0x076ea82a, 2 | BRF_PRG | BRF_ESS }, // 4
{ "db1_6.6l", 0x2000, 0xc080b66c, 3 | BRF_GRA }, // 5 Characters
{ "db1_5.7e", 0x2000, 0x28129aed, 4 | BRF_GRA }, // 6 Background Tiles
{ "db1_8.10n", 0x4000, 0x11942c61, 5 | BRF_GRA }, // 7 Sprites
{ "db1_7.10m", 0x4000, 0xcc130fe2, 5 | BRF_GRA }, // 8
{ "db1-1.2n", 0x0100, 0x3f8cce97, 6 | BRF_GRA }, // 9 Color PROMs
{ "db1-2.2p", 0x0100, 0xafe32436, 6 | BRF_GRA }, // 10
{ "db1-3.2r", 0x0100, 0xc95ff576, 6 | BRF_GRA }, // 11
{ "db1-4.5n", 0x0200, 0xb2180c21, 6 | BRF_GRA }, // 12
{ "db1-5.6n", 0x0200, 0x5e2b3f74, 6 | BRF_GRA }, // 13
};
STD_ROM_PICK(drgnbstr)
STD_ROM_FN(drgnbstr)
struct BurnDriver BurnDrvDrgnbstr = {
"drgnbstr", NULL, NULL, "1984",
"Dragon Buster\0", NULL, "Namco", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, drgnbstrRomInfo, drgnbstrRomName, SkykidInputInfo, DrgnbstrDIPInfo,
DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc,
288, 224, 4, 3
};
| [
"[email protected]"
] | [
[
[
1,
1076
]
]
] |
1ccd8f18e886c5070f1d5ac06740c6b4de3d2bdc | cd0987589d3815de1dea8529a7705caac479e7e9 | /webkit/WebKit/wx/WebKitSupport/ChromeClientWx.cpp | 27fda3aa5b6b92b8b9d958166341a5ee9bafa8a3 | [
"BSD-2-Clause"
] | permissive | azrul2202/WebKit-Smartphone | 0aab1ff641d74f15c0623f00c56806dbc9b59fc1 | 023d6fe819445369134dee793b69de36748e71d7 | refs/heads/master | 2021-01-15T09:24:31.288774 | 2011-07-11T11:12:44 | 2011-07-11T11:12:44 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,322 | cpp | /*
* Copyright (C) 2007 Kevin Ollivier <[email protected]>
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "ChromeClientWx.h"
#include "Console.h"
#if ENABLE(DATABASE)
#include "DatabaseTracker.h"
#endif
#include "FileChooser.h"
#include "FloatRect.h"
#include "Frame.h"
#include "FrameLoadRequest.h"
#include "Icon.h"
#include "NotImplemented.h"
#include "PlatformString.h"
#include "SecurityOrigin.h"
#include "PopupMenuWx.h"
#include "SearchPopupMenuWx.h"
#include "WindowFeatures.h"
#include <stdio.h>
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include <wx/textdlg.h>
#include <wx/tooltip.h>
#include "WebBrowserShell.h"
#include "WebView.h"
#include "WebViewPrivate.h"
namespace WebCore {
wxWebKitWindowFeatures wkFeaturesforWindowFeatures(const WindowFeatures& features)
{
wxWebKitWindowFeatures wkFeatures;
wkFeatures.menuBarVisible = features.menuBarVisible;
wkFeatures.statusBarVisible = features.statusBarVisible;
wkFeatures.toolBarVisible = features.toolBarVisible;
wkFeatures.locationBarVisible = features.locationBarVisible;
wkFeatures.scrollbarsVisible = features.scrollbarsVisible;
wkFeatures.resizable = features.resizable;
wkFeatures.fullscreen = features.fullscreen;
wkFeatures.dialog = features.dialog;
return wkFeatures;
}
ChromeClientWx::ChromeClientWx(wxWebView* webView)
{
m_webView = webView;
}
ChromeClientWx::~ChromeClientWx()
{
}
void ChromeClientWx::chromeDestroyed()
{
notImplemented();
}
void ChromeClientWx::setWindowRect(const FloatRect&)
{
notImplemented();
}
FloatRect ChromeClientWx::windowRect()
{
notImplemented();
return FloatRect();
}
FloatRect ChromeClientWx::pageRect()
{
notImplemented();
return FloatRect();
}
float ChromeClientWx::scaleFactor()
{
notImplemented();
return 0.0;
}
void ChromeClientWx::focus()
{
notImplemented();
}
void ChromeClientWx::unfocus()
{
notImplemented();
}
bool ChromeClientWx::canTakeFocus(FocusDirection)
{
notImplemented();
return false;
}
void ChromeClientWx::takeFocus(FocusDirection)
{
notImplemented();
}
void ChromeClientWx::focusedNodeChanged(Node*)
{
}
Page* ChromeClientWx::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features)
{
Page* myPage = 0;
wxWebViewNewWindowEvent wkEvent(m_webView);
wkEvent.SetURL(request.resourceRequest().url().string());
wxWebKitWindowFeatures wkFeatures = wkFeaturesforWindowFeatures(features);
wkEvent.SetWindowFeatures(wkFeatures);
if (m_webView->GetEventHandler()->ProcessEvent(wkEvent)) {
if (wxWebView* webView = wkEvent.GetWebView()) {
WebViewPrivate* impl = webView->m_impl;
if (impl)
myPage = impl->page;
}
}
return myPage;
}
Page* ChromeClientWx::createModalDialog(Frame*, const FrameLoadRequest&)
{
notImplemented();
return 0;
}
void ChromeClientWx::show()
{
notImplemented();
}
bool ChromeClientWx::canRunModal()
{
notImplemented();
return false;
}
void ChromeClientWx::runModal()
{
notImplemented();
}
void ChromeClientWx::setToolbarsVisible(bool)
{
notImplemented();
}
bool ChromeClientWx::toolbarsVisible()
{
notImplemented();
return false;
}
void ChromeClientWx::setStatusbarVisible(bool)
{
notImplemented();
}
bool ChromeClientWx::statusbarVisible()
{
notImplemented();
return false;
}
void ChromeClientWx::setScrollbarsVisible(bool)
{
notImplemented();
}
bool ChromeClientWx::scrollbarsVisible()
{
notImplemented();
return false;
}
void ChromeClientWx::setMenubarVisible(bool)
{
notImplemented();
}
bool ChromeClientWx::menubarVisible()
{
notImplemented();
return false;
}
void ChromeClientWx::setResizable(bool)
{
notImplemented();
}
void ChromeClientWx::addMessageToConsole(MessageSource source,
MessageType type,
MessageLevel level,
const String& message,
unsigned int lineNumber,
const String& sourceID)
{
if (m_webView) {
wxWebViewConsoleMessageEvent wkEvent(m_webView);
wkEvent.SetMessage(message);
wkEvent.SetLineNumber(lineNumber);
wkEvent.SetSourceID(sourceID);
wkEvent.SetLevel(static_cast<wxWebViewConsoleMessageLevel>(level));
m_webView->GetEventHandler()->ProcessEvent(wkEvent);
}
}
bool ChromeClientWx::canRunBeforeUnloadConfirmPanel()
{
notImplemented();
return true;
}
bool ChromeClientWx::runBeforeUnloadConfirmPanel(const String& string,
Frame* frame)
{
wxMessageDialog dialog(NULL, string, wxT("Confirm Action?"), wxYES_NO);
return dialog.ShowModal() == wxYES;
}
void ChromeClientWx::closeWindowSoon()
{
notImplemented();
}
/*
Sites for testing prompts:
Alert - just type in a bad web address or http://www.htmlite.com/JS002.php
Prompt - http://www.htmlite.com/JS007.php
Confirm - http://www.htmlite.com/JS006.php
*/
void ChromeClientWx::runJavaScriptAlert(Frame* frame, const String& string)
{
if (m_webView) {
wxWebViewAlertEvent wkEvent(m_webView);
wkEvent.SetMessage(string);
if (!m_webView->GetEventHandler()->ProcessEvent(wkEvent))
wxMessageBox(string, wxT("JavaScript Alert"), wxOK);
}
}
bool ChromeClientWx::runJavaScriptConfirm(Frame* frame, const String& string)
{
bool result = false;
if (m_webView) {
wxWebViewConfirmEvent wkEvent(m_webView);
wkEvent.SetMessage(string);
if (m_webView->GetEventHandler()->ProcessEvent(wkEvent))
result = wkEvent.GetReturnCode() == wxID_YES;
else {
wxMessageDialog dialog(NULL, string, wxT("JavaScript Confirm"), wxYES_NO);
dialog.Centre();
result = (dialog.ShowModal() == wxID_YES);
}
}
return result;
}
bool ChromeClientWx::runJavaScriptPrompt(Frame* frame, const String& message, const String& defaultValue, String& result)
{
if (m_webView) {
wxWebViewPromptEvent wkEvent(m_webView);
wkEvent.SetMessage(message);
wkEvent.SetResponse(defaultValue);
if (m_webView->GetEventHandler()->ProcessEvent(wkEvent)) {
result = wkEvent.GetResponse();
return true;
}
else {
wxTextEntryDialog dialog(NULL, message, wxT("JavaScript Prompt"), wxEmptyString, wxOK | wxCANCEL);
dialog.Centre();
if (dialog.ShowModal() == wxID_OK) {
result = dialog.GetValue();
return true;
}
}
}
return false;
}
void ChromeClientWx::setStatusbarText(const String&)
{
notImplemented();
}
bool ChromeClientWx::shouldInterruptJavaScript()
{
notImplemented();
return false;
}
bool ChromeClientWx::tabsToLinks() const
{
notImplemented();
return false;
}
IntRect ChromeClientWx::windowResizerRect() const
{
notImplemented();
return IntRect();
}
void ChromeClientWx::invalidateWindow(const IntRect& rect, bool immediate)
{
if (immediate)
m_webView->Update();
}
void ChromeClientWx::invalidateContentsForSlowScroll(const IntRect& rect, bool immediate)
{
invalidateContentsAndWindow(rect, immediate);
}
void ChromeClientWx::invalidateContentsAndWindow(const IntRect& rect, bool immediate)
{
if (!m_webView)
return;
m_webView->RefreshRect(rect);
if (immediate) {
m_webView->Update();
}
}
IntRect ChromeClientWx::windowToScreen(const IntRect& rect) const
{
notImplemented();
return rect;
}
IntPoint ChromeClientWx::screenToWindow(const IntPoint& point) const
{
notImplemented();
return point;
}
PlatformPageClient ChromeClientWx::platformPageClient() const
{
return m_webView;
}
void ChromeClientWx::contentsSizeChanged(Frame*, const IntSize&) const
{
notImplemented();
}
void ChromeClientWx::scrollBackingStore(int dx, int dy,
const IntRect& scrollViewRect,
const IntRect& clipRect)
{
notImplemented();
}
void ChromeClientWx::updateBackingStore()
{
notImplemented();
}
void ChromeClientWx::mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags)
{
notImplemented();
}
void ChromeClientWx::setToolTip(const String& tip, TextDirection)
{
wxToolTip* tooltip = m_webView->GetToolTip();
if (!tooltip || tooltip->GetTip() != wxString(tip))
m_webView->SetToolTip(tip);
}
void ChromeClientWx::print(Frame*)
{
notImplemented();
}
#if ENABLE(DATABASE)
void ChromeClientWx::exceededDatabaseQuota(Frame*, const String&)
{
unsigned long long quota = 5 * 1024 * 1024;
if (wxWebFrame* webFrame = m_webView->GetMainFrame())
if (Frame* frame = webFrame->GetFrame())
if (Document* document = frame->document())
if (!DatabaseTracker::tracker().hasEntryForOrigin(document->securityOrigin()))
DatabaseTracker::tracker().setQuota(document->securityOrigin(), quota);
}
#endif
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
void ChromeClientWx::reachedMaxAppCacheSize(int64_t spaceNeeded)
{
notImplemented();
}
void ChromeClientWx::reachedApplicationCacheOriginQuota(SecurityOrigin*)
{
notImplemented();
}
#endif
void ChromeClientWx::scroll(const IntSize&, const IntRect&, const IntRect&)
{
m_webView->Refresh();
notImplemented();
}
void ChromeClientWx::runOpenPanel(Frame*, PassRefPtr<FileChooser>)
{
notImplemented();
}
void ChromeClientWx::chooseIconForFiles(const Vector<String>& filenames, FileChooser* chooser)
{
chooser->iconLoaded(Icon::createIconForFiles(filenames));
}
void ChromeClientWx::setCursor(const Cursor&)
{
notImplemented();
}
void ChromeClientWx::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
{
// See the comment in WebCore/page/ChromeClient.h
notImplemented();
}
bool ChromeClientWx::selectItemWritingDirectionIsNatural()
{
return false;
}
PassRefPtr<PopupMenu> ChromeClientWx::createPopupMenu(PopupMenuClient* client) const
{
return adoptRef(new PopupMenuWx(client));
}
PassRefPtr<SearchPopupMenu> ChromeClientWx::createSearchPopupMenu(PopupMenuClient* client) const
{
return adoptRef(new SearchPopupMenuWx(client));
}
}
| [
"[email protected]"
] | [
[
[
1,
485
]
]
] |
864c4bbd2f1504c998ad7572100a3d3bbbad1a75 | 41efaed82e413e06f31b65633ed12adce4b7abc2 | /projects/lab4/src/MyFrontCamera.cpp | b05ffbddfc393c134dfb801575ecbcfa26192395 | [] | no_license | ivandro/AVT---project | e0494f2e505f76494feb0272d1f41f5d8f117ac5 | ef6fe6ebfe4d01e4eef704fb9f6a919c9cddd97f | refs/heads/master | 2016-09-06T03:45:35.997569 | 2011-10-27T15:00:14 | 2011-10-27T15:00:14 | 2,642,435 | 0 | 2 | null | 2016-04-08T14:24:40 | 2011-10-25T09:47:13 | C | UTF-8 | C++ | false | false | 762 | cpp | #include "MyFrontCamera.h"
namespace lab4 {
MyFrontCamera::MyFrontCamera() : Entity("Camera") {
}
MyFrontCamera::~MyFrontCamera() {
}
void MyFrontCamera::init() {
cg::tWindowInfo win = cg::Manager::instance()->getApp()->getWindowInfo();
_winWidth = win.width;
_winHeight = win.height;
_position.set(0,10,-15);
}
void MyFrontCamera::draw() {
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60,_winWidth/(double)_winHeight,1.0,100.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(_position[0],_position[1],_position[2],0,0,0,0,1,0);
}
void MyFrontCamera::onReshape(int width, int height) {
_winWidth = width;
_winHeight = height;
}
}
| [
"Moreira@Moreira-PC.(none)"
] | [
[
[
1,
27
]
]
] |
db4033c6033d0f6627ed75725216de0166c69aa2 | 5fea042a436493f474afaf862ea592fa37c506ab | /Antihack/message.cpp | 1f1c921af01bf48340e6278c352804ed0a0e8bea | [] | no_license | Danteoriginal/twilight-antihack | 9fde8fbd2f34954752dc2de3927490d657b43739 | 4ccc51c13c33abcb5e370ef1b992436e6a1533c9 | refs/heads/master | 2021-01-13T06:25:31.618338 | 2009-10-25T14:44:34 | 2009-10-25T14:44:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 913 | cpp | #include "message.h"
CMessage::CMessage(std::string msg, int duration, DWORD color)
{
this->msg = msg;
this->duration = duration;
oldTime = GetTickCount();
this->color = color;
}
bool CMessage::HasExpired()
{
if (duration == INFINITE) return false;
int deltaTime = GetTickCount() - oldTime;
int threshhold = duration / 2; // how long it should wait before fading
DWORD alpha = 0xFF; // default
// 0x000000AA
if (deltaTime >= threshhold) {
// I cant remember how I came up with this formula but it gives good results
alpha = static_cast<unsigned char>(0xFF - sin((double)((deltaTime - threshhold) / (double)(duration - threshhold))*1.5)*0xFF);
}
alpha <<= 24; // set to 0xAA000000
color = color&0x00FFFFFF; // filter out alpha channel
// 0x00RRGGBB
color |= alpha; // blend in new alpha
// 0xAARRGGBB
return (deltaTime >= duration);
} | [
"[email protected]"
] | [
[
[
1,
34
]
]
] |
c8d96ca87256e11def58d686bce8e058886a8bcc | 29f0a6c56e3c4528f64c3a1ad18fc5f074ae1146 | /Praktikum Info2/Aufgabenblock_3/Fahrrad.cpp | 24946b0aa5e32937e95cbfc3f2faaf71adb7d576 | [] | no_license | JohN-D/Info-2-Praktikum | 8ccb0348bedf38a619a39b17b0425d6b4c16a72d | c11a274e9c4469a31f40d0abec2365545344b534 | refs/heads/master | 2021-01-01T18:34:31.347062 | 2011-10-19T20:18:47 | 2011-10-19T20:18:47 | 2,608,736 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,215 | cpp | #include "Fahrrad.h"
#include "SimuClient.h"
#include "Weg.h"
Fahrrad::~Fahrrad(void)
{
//cout << "Destruiere: " << p_sName << endl;
}
double Fahrrad::dGeschwindigkeit()
{
int iTeilstrecken = (int) p_dGesamtStrecke / 20;
double temp = p_dMaxGeschwindigkeit*pow(0.9, iTeilstrecken);
if(temp<12)
{
temp=12;
}
//cout << "Die Geschwindigkeit betraegt jetzt: " << temp << "km/h." << endl;
return temp;
}
ostream& Fahrrad::ostreamAusgabe(ostream& Ausgabe)
{
Fahrzeug::ostreamAusgabe(Ausgabe);
Ausgabe << setw(16) << "";
Ausgabe << setw(12) << "";
Ausgabe << setw(10) << setiosflags(ios::right) << setiosflags(ios::fixed) << dGeschwindigkeit();
Ausgabe << resetiosflags(ios::right) << resetiosflags(ios::fixed);
return Ausgabe;
}
istream& Fahrrad::istreamEingabe(istream& Eingabe)
{
Fahrzeug::istreamEingabe(Eingabe);
return Eingabe;
}
ostream& operator<<(ostream& out, Fahrrad& objekt)
{
objekt.Fahrrad::ostreamAusgabe(out);
return out;
}
void Fahrrad::vZeichnen(Weg* pWeg)
{
double dTemp=p_dAbschnittStrecke/pWeg->getLaenge();
if(dTemp<0.01)
{
dTemp=0.001;
}
bZeichneFahrrad(p_sName, pWeg->getName(), dTemp, dGeschwindigkeit());
} | [
"[email protected]"
] | [
[
[
1,
55
]
]
] |
d433d20b4722730d81026b6eba1a54a7a82fe1df | f184f6e26378d681d02b4baf6fe25db039e0a418 | /Vision/trunk/ObjectDetectionUtil/ObjectDetectionUtil/src/objdetectionutil.cpp | 3589f263e5804e6d067d959ec8f319ff79e4b279 | [] | no_license | btabibian/SDP12 | 761e798c79eefa9e4e545593928106d0874a4a10 | 579552bf267a045f8223649ad9718fc26dafd236 | refs/heads/master | 2021-01-18T05:14:58.207853 | 2011-04-20T21:13:05 | 2011-04-20T21:13:05 | 1,618,762 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 17,988 | cpp | /*
This file is part of Implementation of SDP Group 12 Vision program.
Implementation of SDP Group 12 Vision is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Implementation of SDP Group 12 Vision is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Implementation of SDP Group 12 Vision. If not, see <http://www.gnu.org/licenses/>.
University of Edinburgh, hereby disclaims all copyright interest in the program
"SDP Group 12 Vision" written by Behzad Tabibian.
*/
#include "objdetectionutil.h"
bool clr_picker=0;
CvScalar color;
CvScalar max_color;
CvScalar min_color;
// Color threshold for Black Dot
CvScalar hsv_min_D = cvScalar(0,5,15);
CvScalar hsv_max_D = cvScalar(61,255,255);
// Color threshold for Red Ball
CvScalar hsv_min_B = cvScalar(0,131,104);
CvScalar hsv_max_B = cvScalar(10,255,255);
// Color threshold for Yellow T
CvScalar hsv_min_TY = cvScalar(0,8,69);
CvScalar hsv_max_TY = cvScalar(8,242,157);
// Color threshold for Blue T
CvScalar hsv_min_TB = cvScalar(31,6,0);
CvScalar hsv_max_TB = cvScalar(78,255,255);
void objDetection::utilities::showResults(IplImage*& frame,config& conf,IplImage*& thresh1,IplImage*& thresh2,IplImage*& thresh3,int64 diffTime)
{
//cvShowImage("Test Window4",frame);
IplImage* frame_c=cvCreateImage(cvSize(frame->width,frame->height),frame->depth,frame->nChannels);
IplImage* thresh1_c=cvCreateImage(cvSize(thresh1->width,thresh1->height),frame->depth,frame->nChannels);
IplImage* thresh2_c=cvCreateImage(cvSize(thresh2->width,thresh2->height),frame->depth,frame->nChannels);
IplImage* thresh3_c=cvCreateImage(cvSize(thresh3->width,thresh3->height),frame->depth,frame->nChannels);
cvCopy(frame,frame_c);
cvConvertImage(thresh1,thresh1_c);
cvConvertImage(thresh2,thresh2_c);
cvConvertImage(thresh3,thresh3_c);
IplImage* disp=objDetection::utilities::cvShowManyImages("Camera",4,frame_c,thresh1_c,thresh2_c,thresh3_c);
conf.totalTime+=diffTime;
conf.Opcount++;
float meanfps=1/( ( ( (float)conf.totalTime )/conf.Opcount) /cv::getTickFrequency());
float fps=1/(((float)diffTime)/cv::getTickFrequency());
if(disp && conf.show)
{
int w=disp->width;
int h=disp->height;
CvFont font;
cvInitFont(&font, CV_FONT_HERSHEY_SIMPLEX, 0.4, 0.4, 0, 1, CV_AA);
stringstream ss;
ss.setf(ios::fixed,ios::floatfield);
ss.precision(1);
ss<<"fps: "<<fps;
CvPoint point=cvPoint(10, h-100);
cvPutText(disp,ss.str().c_str(),point, &font, cvScalar(0, 0, 0, 0));
ss.str("");
ss<<"mean fps: "<<meanfps;
CvPoint point2=point;
point2.x+=80;
cvPutText(disp,ss.str().c_str(),point2, &font, cvScalar(0, 0, 0, 0));
ss.str("");
point.y+=20;
ss<<"Blue T pos:"<<conf.sel_TB.center.x<<","<<conf.sel_TB.center.y<<","<<conf.sel_TB.angle*180/PI;
cvPutText(disp,ss.str().c_str(),point, &font, cvScalar(0, 0, 0, 0));
ss.str("");
point.y+=20;
ss<<"Yellow T pos:"<<conf.sel_TY.center.x<<","<<conf.sel_TY.center.y<<","<<conf.sel_TY.angle*180/PI;
cvPutText(disp,ss.str().c_str(),point, &font, cvScalar(0, 0, 0, 0));
ss.str("");
point.y+=20;
ss<<"Ball pos:"<<conf.rect_B.x<<","<<conf.rect_B.y;
cvPutText(disp,ss.str().c_str(),point, &font, cvScalar(0, 0, 0, 0));
cvShowImage("Camera",disp);
}
//std::cout.setf(ios::fixed,ios::floatfield);
std::cout.precision(1);
//std::cout<<"fps: "<<fps<<" - mean fps: "<<meanfps<<std::endl;
cvReleaseImage(&disp);
cvReleaseImage(&frame_c);
cvReleaseImage(&thresh1_c);
cvReleaseImage(&thresh2_c);
cvReleaseImage(&thresh3_c);
}
IplImage* objDetection::utilities::getImageFromCamera(config& conf)
{
if( !cvGrabFrame( conf.capture ))
{
std::cout<<"Camera Stopped working, Closing"<<std::endl;
return NULL;
}
IplImage* img= cvRetrieveFrame( conf.capture );
IplImage* res= cvCreateImage(cvSize(img->width,img->height), img->depth,3);
cvCopy(img,res);
return res;
}
void objDetection::utilities::getImageFromFile(const char* file,IplImage*& image)
{
image=cvLoadImage(file);
}
void objDetection::utilities::releaseCurrentFrame(config& conf)
{
cvReleaseImage(&conf.current_frame);
}
std::string objDetection::utilities::getNextImageFileName(config& conf)
{
if(conf.i_base.current>=conf.i_base.image_end)
return "";
std::stringstream ss;
ss<<conf.i_base.basefile<<conf.i_base.current<<".jpg";
std::string currentFile=ss.str();
conf.i_base.current++;
return currentFile;
}
bool objDetection::utilities::getNextFrame(config& conf)
{
if(conf.camera)
{
conf.current_frame=getImageFromCamera(conf);
if(conf.current_frame==NULL)
return false;
}
else if(conf.image_file)
{
std::string add=getNextImageFileName(conf);
if(strcmp(add.c_str(),"")!=0)
getImageFromFile(add.c_str(),conf.current_frame);
else
return false;
}
if(conf.current_frame==NULL)
{
return false;
}
cropFrame(conf,conf.current_frame);
return true;
}
void objDetection::utilities::cropFrame(config& conf,IplImage*& img)
{
int w=conf.windowOfInterest.Width;
int h=conf.windowOfInterest.Height;
cvSetImageROI(img,cvRect(conf.windowOfInterest.X,conf.windowOfInterest.Y,w,h));
IplImage* temp=cvCreateImage(cvSize(w,h), img->depth,3);
cvCopy(img,temp);
cvReleaseImage(&img);
img=temp;
}
void objDetection::utilities::setupBackgroundImage(config& conf)
{
if(!conf.back)
{
if(conf.camera)
{
getImageFromFile("bg.jpg",conf.background);
if(conf.background)
{
std::cout<<"background loaded"<<std::endl;
}
else
{
std::cout<<"Setup for Background image"<<std::endl;
conf.background = getImageFromCamera(conf);
}
}
else if(conf.image_file)
{
getImageFromFile(getNextImageFileName(conf).c_str(),conf.background);
}
conf.back=true;
cropFrame(conf,conf.background);
}
}
void objDetection::utilities::initImageStack(config& conf)
{
if(conf.camera)
{
std::cout<<"Going for Camera"<<std::endl;
conf.capture=cvCaptureFromCAM(0);
}
if(conf.image_file)
{
conf.i_base.current=conf.i_base.image_start;
}
if(conf.image_file)
{
objDetection::utilities::cb_init(&conf.TY_Buffer,1,sizeof(float));
objDetection::utilities::cb_init(&conf.TB_Buffer,1,sizeof(float));
}
if(conf.camera)
{
objDetection::utilities::cb_init(&conf.TY_Buffer,1,sizeof(float));
objDetection::utilities::cb_init(&conf.TB_Buffer,1,sizeof(float));
}
}
void objDetection::utilities::output(config& conf,ofstream* file)
{
if(conf.outputToText||conf.outputToConsole)
{
//std::cout<<"outputToConsole"<<std::endl;
stringstream ss;
ss<<conf.sel_TB.center.x<<","<<conf.sel_TB.center.y<<","<<conf.sel_TB.angle<<",";
ss<<conf.rect_B.x<<","<<conf.rect_B.y<<",";
ss<<conf.sel_TY.center.x<<","<<conf.sel_TY.center.y<<","<<conf.sel_TY.angle;
ss<<std::endl;
if(conf.outputToText)
*(file)<<ss.str();
if(conf.outputToConsole)
std::cerr<<ss.str();
}
}
void objDetection::utilities::show(config& conf)
{
if(conf.show)
{
try
{
objDetection::drawOrientation(conf.current_frame,conf.sel_TB);
objDetection::drawOrientation(conf.current_frame,conf.sel_TY);
cvRectangle(conf.current_frame,cvPoint(conf.rect_B.x,conf.rect_B.y),cvPoint(conf.rect_B.x+conf.rect_B.width,conf.rect_B.y+conf.rect_B.height),cvScalar(0,0,0),3);
}
catch(std::exception ex)
{
return;
}
}
}
void objDetection::utilities::initFile(config& conf,ofstream*& file)
{
if(conf.outputToText)
file=new ofstream(conf.outputfile);
}
config objDetection::utilities::get_Config(int argc, char* argv[])
{
config res;
res.camera=false;
res.image_file=false;
res.train_major=false;
res.train_minor=false;
res.show=false;
res.back=false;
res.outputfile=false; res.outputToConsole=false;
res.outputToText=false;
res.predict_major=false;
res.predict_minor=false;
res.totalTime=0;
res.Opcount=0;
res.hsv_max_B=hsv_max_B;
res.hsv_max_D=hsv_max_D;
res.hsv_max_TB=hsv_max_TB;
res.hsv_max_TY=hsv_max_TY;
res.hsv_min_B=hsv_min_B;
res.hsv_min_TB=hsv_min_TB;
res.hsv_min_TY=hsv_min_TY;
res.hsv_min_D=hsv_min_D;
res.storage=cvCreateMemStorage(0);
res.windowOfInterest.X=80;
res.windowOfInterest.Y= 110;
res.windowOfInterest.Width=540;
res.windowOfInterest.Height= 290;
int currentIndex=1;
if(argv[currentIndex][0]=='c')
{
res.camera=true;
}
if(argv[currentIndex][0]=='i')
{
res.image_file=true;
res.i_base.current=1;
//go for image file
}
currentIndex++;
if(res.image_file)
{
res.i_base.basefile=argv[currentIndex];
currentIndex++;
}
if(res.image_file)
{
res.i_base.image_start=atoi(argv[currentIndex]);
currentIndex++;
}
if(res.image_file)
{
res.i_base.step=atoi(argv[currentIndex]);
currentIndex++;
}
if(res.image_file)
{
res.i_base.image_end=atoi(argv[currentIndex]);
currentIndex++;
}
if(!strcmp(argv[currentIndex],"window"))
{
currentIndex++;
res.windowOfInterest.X=atoi(argv[currentIndex]);
currentIndex++;
res.windowOfInterest.Y=atoi(argv[currentIndex]);
currentIndex++;
res.windowOfInterest.Width=atoi(argv[currentIndex]);
currentIndex++;
res.windowOfInterest.Height=atoi(argv[currentIndex]);
currentIndex++;
}
if(!strcmp(argv[currentIndex],"train_major"))
{
res.train_major=true;
}
if(!strcmp(argv[currentIndex],"train_minor"))
{
res.train_minor=true;
}
if(!strcmp(argv[currentIndex],"predict_major"))
{
res.predict_major=true;
}
if(!strcmp(argv[currentIndex],"predict_minor"))
{
res.predict_minor=true;
}
currentIndex++;
if(currentIndex==argc)
{
return res;
}
std::cout<<"loading config"<<std::endl;
for(int i=0;i<3;i++)
{
if(!strcmp(argv[currentIndex],"show"))
{
res.show=true;
} else if(!strcmp(argv[currentIndex],"outputToText"))
{
res.outputToText=true;
currentIndex++;
res.outputfile=argv[currentIndex];
} else if(!strcmp(argv[currentIndex],"outputToConsole"))
{
res.outputToConsole=true;
}else
break;
currentIndex++;
if(currentIndex==argc)
{
return res;
}
}
if(currentIndex==argc)
{
return res;
}
if(!strcmp(argv[currentIndex],"TY_min"))
{
currentIndex++;
stringstream ss(argv[currentIndex]);
double m1;
ss>>m1;
currentIndex++;
stringstream ss2(argv[currentIndex]);
double m2;
ss2>>m2;
currentIndex++;
stringstream ss3(argv[currentIndex]);
double m3;
ss3>>m3;
currentIndex++;
res.hsv_min_TY= cvScalar(m1,m2,m3);
}
if(currentIndex==argc)
{
return res;
}
if(!strcmp(argv[currentIndex],"TY_max"))
{
currentIndex++;
stringstream ss(argv[currentIndex]);
double m1;
ss>>m1;
currentIndex++;
stringstream ss2(argv[currentIndex]);
double m2;
ss2>>m2;
currentIndex++;
stringstream ss3(argv[currentIndex]);
double m3;
ss3>>m3;
currentIndex++;
res.hsv_max_TY= cvScalar(m1,m2,m3);
}
if(!strcmp(argv[currentIndex],"TB_min"))
{
currentIndex++;
stringstream ss(argv[currentIndex]);
double m1;
ss>>m1;
currentIndex++;
stringstream ss2(argv[currentIndex]);
double m2;
ss2>>m2;
currentIndex++;
stringstream ss3(argv[currentIndex]);
double m3;
ss3>>m3;
currentIndex++;
res.hsv_min_TB= cvScalar(m1,m2,m3);
}
if(currentIndex==argc)
{
return res;
}
if(!strcmp(argv[currentIndex],"TB_max"))
{
currentIndex++;
stringstream ss(argv[currentIndex]);
double m1;
ss>>m1;
currentIndex++;
stringstream ss2(argv[currentIndex]);
double m2;
ss2>>m2;
currentIndex++;
stringstream ss3(argv[currentIndex]);
double m3;
ss3>>m3;
currentIndex++;
res.hsv_max_TB= cvScalar(m1,m2,m3);
}
return res;
}
void objDetection::utilities::cb_init(circular_buffer *cb, size_t capacity, size_t sz)
{
cb->buffer = malloc(capacity * sz);
if(cb->buffer == NULL);
// handle error
cb->buffer_end = (char *)cb->buffer + capacity * sz;
cb->capacity = capacity;
cb->count = 0;
cb->sz = sz;
cb->head = cb->buffer;
cb->tail = cb->buffer;
}
float objDetection::utilities::average_cb_buffer(circular_buffer *cb)
{
void* item=cb->tail;
int count=cb->count;
float value;
float sum=0;
while(true)
{
if(count == 0)
break;
memcpy(&value, item, cb->sz);
sum+=value;
item = (char*)item + cb->sz;
if(item == cb->buffer_end)
item = cb->buffer;
count--;
}
return sum/cb->count;
}
void objDetection::utilities::cb_free(circular_buffer *cb)
{
free(cb->buffer);
// clear out other fields too, just to be safe
}
void objDetection::utilities::cb_push_back(circular_buffer *cb, const void *item)
{
if(cb->count == cb->capacity)
cb->count--;
memcpy(cb->head, item, cb->sz);
cb->head = (char*)cb->head + cb->sz;
if(cb->head == cb->buffer_end)
cb->head = cb->buffer;
cb->count++;
}
void objDetection::utilities::cb_pop_front(circular_buffer *cb, void *item)
{
if(cb->count == 0);
{
item=NULL;
return;
}
memcpy(item, cb->tail, cb->sz);
cb->tail = (char*)cb->tail + cb->sz;
if(cb->tail == cb->buffer_end)
cb->tail = cb->buffer;
cb->count--;
}
IplImage* objDetection::utilities::cvShowManyImages(const char* title, int nArgs, ...) {
// img - Used for getting the arguments
IplImage *img;
// DispImage - the image in which input images are to be copied
IplImage *DispImage;
int size;
int i;
int m, n;
int x, y;
// w - Maximum number of images in a row
// h - Maximum number of images in a column
int w, h;
// scale - How much we have to resize the image
float scale;
int max;
// If the number of arguments is lesser than 0 or greater than 12
// return without displaying
if(nArgs <= 0) {
printf("Number of arguments too small....\n");
return NULL;
}
else if(nArgs > 12) {
printf("Number of arguments too large....\n");
return NULL;
}
// Determine the size of the image,
// and the number of rows/cols
// from number of arguments
else if (nArgs == 1) {
w = h = 1;
size = 300;
}
else if (nArgs == 2) {
w = 2; h = 1;
size = 300;
}
else if (nArgs == 3 || nArgs == 4) {
w = 2; h = 2;
size = 300;
}
else if (nArgs == 5 || nArgs == 6) {
w = 3; h = 2;
size = 200;
}
else if (nArgs == 7 || nArgs == 8) {
w = 4; h = 2;
size = 200;
}
else {
w = 4; h = 3;
size = 150;
}
// Create a new 3 channel image
DispImage = cvCreateImage( cvSize(100 + size*w, 60 + size*h), 8, 3 );
cvSet(DispImage,cvScalarAll(100),0);
// Used to get the arguments passed
va_list args;
va_start(args, nArgs);
// Loop for nArgs number of arguments
for (i = 0, m = 20, n = 20; i < nArgs; i++, m += (20 + size)) {
// Get the Pointer to the IplImage
img = va_arg(args, IplImage*);
// Check whether it is NULL or not
// If it is NULL, release the image, and return
if(img == 0) {
printf("Invalid arguments");
cvReleaseImage(&DispImage);
return NULL;
}
// Find the width and height of the image
x = img->width;
y = img->height;
// Find whether height or width is greater in order to resize the image
max = (x > y)? x: y;
// Find the scaling factor to resize the image
scale = (float) ( (float) max / size );
// Used to Align the images
if( i % w == 0 && m!= 20) {
m = 20;
n+= 20 + size;
}
// Set the image ROI to display the current image
cvSetImageROI(DispImage, cvRect(m, n, (int)( x/scale ), (int)( y/scale )));
// Resize the input image and copy the it to the Single Big Image
cvResize(img, DispImage);
// Reset the ROI in order to display the next image
cvResetImageROI(DispImage);
}
// Create a new window, and show the Single Big Image
//cvNamedWindow( title, 1 );
va_end(args);
return DispImage;
//cvShowImage( title, DispImage);
//cvWaitKey();
//cvDestroyWindow(title);
// End the number of arguments
// Release the Image Memory
//cvReleaseImage(&DispImage);
}
void my_mouse_callback(int event, int x, int y, int flags, void* param)
{
if(flags&CV_EVENT_LBUTTONDOWN)
{
clr_picker=1;
IplImage* frame=(IplImage*)param;
CvSize size=cvSize(frame->width,frame->height);
uchar* ptr = (uchar*) (frame->imageData + y * frame->widthStep);
color=cvScalar(ptr[3*x],ptr[3*x+1],ptr[3*x+2]);
cvDrawCircle(param,cvPoint(x,y),5,color,4);
std::cout<<"current:"<<color.val[0]<<","<<color.val[1]<<","<<color.val[2]<<","<<color.val[3]<<std::endl;
if(max_color.val[0]<color.val[0])
max_color.val[0]=color.val[0];
if(max_color.val[1]<color.val[1])
max_color.val[1]=color.val[1];
if(max_color.val[2]<color.val[2])
max_color.val[2]=color.val[2];
if(min_color.val[0]>color.val[0])
min_color.val[0]=color.val[0];
if(min_color.val[1]>color.val[1])
min_color.val[1]=color.val[1];
if(min_color.val[2]>color.val[2])
min_color.val[2]=color.val[2];
}
}
CvScalar objDetection::utilities::colorPicker(IplImage* img)
{
if(!img)
return CvScalar();
cvNamedWindow( "Color Picker", CV_WINDOW_AUTOSIZE );
cvShowImage( "Color Picker", img ); // Original stream with detected ball overlay
cvSetMouseCallback("Color Picker",my_mouse_callback,img);
cvWaitKey(0);
cvShowImage( "Color Picker", img ); // Original stream with detected ball overlay
cvDestroyWindow("Color Picker");
return color;
}
| [
"[email protected]",
"[email protected]"
] | [
[
[
1,
525
],
[
527,
692
]
],
[
[
526,
526
]
]
] |
7ea499dff96257f4a59842b48533ec5965579078 | 38926bfe477f933a307f51376dd3c356e7893ffc | /Source/GameDLL/NetInputChainDebug.cpp | 65428b5606f37d07a55e12874f73c2041cd4318c | [] | no_license | richmondx/dead6 | b0e9dd94a0ebb297c0c6e9c4f24c6482ef4d5161 | 955f76f35d94ed5f991871407f3d3ad83f06a530 | refs/heads/master | 2021-12-05T14:32:01.782047 | 2008-01-01T13:13:39 | 2008-01-01T13:13:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,287 | cpp | /*************************************************************************
Crytek Source File.
Copyright (C), Crytek Studios, 2001-2004.
-------------------------------------------------------------------------
Description: Utilities for debugging input synchronization problems
-------------------------------------------------------------------------
History:
- 30:03:2007 : Created by Craig Tiller
*************************************************************************/
#include "StdAfx.h"
#include "NetInputChainDebug.h"
#include "IEntitySystem.h"
#include "ITextModeConsole.h"
#if ENABLE_NETINPUTCHAINDEBUG
#include "ConfigurableVariant.h"
#ifndef XENON
#include <windows.h>
#endif
EntityId _netinputchain_debugentity = 0;
static int lastFrame = -100;
static int ypos = 0;
static int dump = 0;
static uint64 tstamp;
typedef NTypelist::CConstruct<float, Vec3>::TType TNetInputValueTypes;
typedef CConfigurableVariant<TNetInputValueTypes, NTypelist::MaximumSize<TNetInputValueTypes>::value> TNetInputValue;
static const char * GetEntityName()
{
IEntity * pEnt = gEnv->pEntitySystem->GetEntity(_netinputchain_debugentity);
assert(pEnt);
if (pEnt)
return pEnt->GetName();
else
return "<<unknown>>";
}
static void Put( const char * name, const TNetInputValue& value )
{
FILE * fout = 0;
if (dump) fout = fopen("netinput.log", "at");
FILETIME tm;
GetSystemTimeAsFileTime(&tm);
ITextModeConsole * pTMC = gEnv->pSystem->GetITextModeConsole();
if (lastFrame != gEnv->pRenderer->GetFrameID())
{
ypos = 0;
lastFrame = gEnv->pRenderer->GetFrameID();
tstamp = (uint64(tm.dwHighDateTime)<<32) | tm.dwLowDateTime;
}
float white[] = {1,1,1,1};
char buf[256];
if (const Vec3 * pVec = value.GetPtr<Vec3>())
{
sprintf(buf, "%s: %f %f %f", name, pVec->x, pVec->y, pVec->z);
gEnv->pRenderer->Draw2dLabel(10, ypos+=20, 2, white, false, "%s", buf);
if (pTMC)
pTMC->PutText( 0, ypos/20, buf );
if (fout) fprintf(fout, "%I64d %s %s %f %f %f\n", tstamp, GetEntityName(), name, pVec->x, pVec->y, pVec->z);
}
else if (const float * pFloat = value.GetPtr<float>())
{
sprintf(buf, "%s: %f", name, *pFloat);
gEnv->pRenderer->Draw2dLabel(10, ypos+=20, 2, white, false, "%s", buf);
if (pTMC)
pTMC->PutText( 0, ypos/20, buf );
if (fout) fprintf(fout, "%I64d %s %s %f\n", tstamp, GetEntityName(), name, *pFloat);
}
if (fout)
fclose(fout);
}
static void OnChangeEntity( ICVar * pVar )
{
const char * entName = pVar->GetString();
if (IEntity * pEnt = gEnv->pEntitySystem->FindEntityByName(entName))
_netinputchain_debugentity = pEnt->GetId();
else
_netinputchain_debugentity = 0;
}
void NetInputChainPrint( const char * name, Vec3 val )
{
Put(name, TNetInputValue(val));
}
void NetInputChainPrint( const char * name, float val )
{
Put(name, TNetInputValue(val));
}
void NetInputChainInitCVars()
{
gEnv->pConsole->RegisterString("net_input_trace", "0", VF_CHEAT, "trace an entities input processing to assist finding sync errors", OnChangeEntity);
gEnv->pConsole->Register("net_input_dump", &dump, 0, VF_CHEAT, "write net_input_trace output to a file (netinput.log)");
}
#else
void NetInputChainInitCVars(){}
#endif
| [
"[email protected]",
"kkirst@c5e09591-5635-0410-80e3-0b71df3ecc31"
] | [
[
[
1,
16
],
[
18,
52
],
[
55,
61
],
[
64,
65
],
[
70,
73
],
[
78,
113
]
],
[
[
17,
17
],
[
53,
54
],
[
62,
63
],
[
66,
69
],
[
74,
77
]
]
] |
10971979e7f3323fb0c891a200669f92c80a2cf3 | 1197bf572cfd5f7c0ce359f1bf7893dc9f6faeff | /cppPrimerPlus/mytime.cpp | dad9815c7875379b1cfa001404ef4aaf6665ce7e | [] | no_license | badcodes/cpp | 07054ba389814b1f5c6a7669151f7e6053b7a077 | b91bc39c541d05c36bfb6210f9908a24867d5ca5 | refs/heads/master | 2020-06-05T04:39:00.359631 | 2010-11-24T20:26:46 | 2010-11-24T20:26:46 | 1,112,893 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 872 | cpp | #include "mytime.h"
#include <iostream>
using namespace std;
TIME::TIME()
{
hour=0;
minute=0;
}
TIME::TIME(const int h,const int m)
{
hour=h;
minute=m;
normalize();
}
void TIME::show(void) const
{
cout<<hour<<":"<<minute;
}
TIME TIME::operator+(const TIME & tt) const
{
TIME sum(hour + tt.hour,minute + tt.minute);
return sum;
}
void TIME::normalize(void)
{
while(minute<0 && hour>0)
{
minute += 60;
hour--;
}
while(minute>60)
{
minute -= 60;
hour++;
}
}
char * TIME::tostring(void)
{
return strcpy(text,"Not implemented.");
}
TIME TIME::operator*(const double by) const
{
TIME result(hour*by,minute*by);
return result;
}
TIME operator*(const double by,const TIME & tt)
{
return tt * by;
}
ostream & operator<<(ostream & os,const TIME & tt)
{
os<<tt.hour<<":"<<tt.minute;
return os;
}
| [
"[email protected]"
] | [
[
[
1,
56
]
]
] |
abcf059de7f7f6780145e7a99f07869b8c4125b2 | 073dfce42b384c9438734daa8ee2b575ff100cc9 | /RCF/include/RCF/RcfBoostThreads/boost_1_33_1/boost/thread/thread.hpp | 7d667b3f4bcf476706fefb3cd2412eace3cdff21 | [] | no_license | r0ssar00/iTunesSpeechBridge | a489426bbe30ac9bf9c7ca09a0b1acd624c1d9bf | 71a27a52e66f90ade339b2b8a7572b53577e2aaf | refs/heads/master | 2020-12-24T17:45:17.838301 | 2009-08-24T22:04:48 | 2009-08-24T22:04:48 | 285,393 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,168 | hpp |
//******************************************************************************
// RCF - Remote Call Framework
// Copyright (c) 2005 - 2009, Jarl Lindrud. All rights reserved.
// Consult your license for conditions of use.
// Version: 1.1
// Contact: jarl.lindrud <at> gmail.com
//******************************************************************************
// Copyright (C) 2001-2003
// William E. Kempf
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appear in all copies and
// that both that copyright notice and this permission notice appear
// in supporting documentation. William E. Kempf makes no representations
// about the suitability of this software for any purpose.
// It is provided "as is" without express or implied warranty.
#ifndef RCF_BOOST_THREAD_WEK070601_HPP
#define RCF_BOOST_THREAD_WEK070601_HPP
#include "mutex.hpp"
namespace boost {
struct xtime;
class RCF_BOOST_THREAD_DECL thread : private ::boost::noncopyable
{
public:
thread();
explicit thread(const ::boost::function0<void>& threadfunc);
~thread();
bool operator==(const thread& other) const;
bool operator!=(const thread& other) const;
void join();
static void sleep(const xtime& xt);
static void yield();
private:
#if defined(BOOST_HAS_WINTHREADS)
void* m_thread;
unsigned int m_id;
#elif defined(BOOST_HAS_PTHREADS)
private:
pthread_t m_thread;
#elif defined(BOOST_HAS_MPTASKS)
MPQueueID m_pJoinQueueID;
MPTaskID m_pTaskID;
#endif
bool m_joinable;
};
class RCF_BOOST_THREAD_DECL thread_group : private ::boost::noncopyable
{
public:
thread_group();
~thread_group();
thread* create_thread(const ::boost::function0<void>& threadfunc);
void add_thread(thread* thrd);
void remove_thread(thread* thrd);
void join_all();
int size();
private:
std::list<thread*> m_threads;
mutex m_mutex;
};
} // namespace boost
#endif // RCF_BOOST_THREAD_WEK070601_HPP
| [
"[email protected]"
] | [
[
[
1,
78
]
]
] |
0f92594027a982fc6dc922450c9e279959a0a385 | fe901ea37ae8a1dbc9fce034f8c4f32a535b06a6 | /L_Shared/yaw/yaw.cpp | afba7bb09c32ffd12420732df9cde866221c8106 | [] | no_license | VB6Hobbyst7/roomba-localization | 93c1dc1bba9102ff770b173ddd0bdb1436d22a86 | f18d7ecf28f29e44806147fe1fef1c32a720eb69 | refs/heads/master | 2021-05-20T10:13:09.064249 | 2011-08-06T20:21:11 | 2011-08-06T20:21:11 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,903 | cpp | /*
* yaw.cpp
*
* Created on: 17-Aug-2010
* Author: nrqm
*
* Interface code for using the IDG-300Q dual-axis gyro sensor.
*
* We use the following circuit for the device:
*
* |----------- GND
* 10 uF ===
* ------------ | 1 kOhm
* | ADC0|----------------------------------vvvv-----
* | Aref|------------------------------ |
* | | | | ------------------
* | | -------------- | +3.3 V -----|X-rate out |
* | +5 V|-------------| LM1086-3.3 |--------------------|Vcc |
* | | | -------------- | ---|GND |
* | | 10 uF === | 10 uF === | | IDG-300Q |
* | | | | | | ------------------
* | GND|---------------------------------------------
* ------------
*
* The X-rot output is put through a passive low-pass filter with a corner around 16 Hz. The sensor supports an
* output frequency around 140 Hz, but 16 Hz is sufficient for our purposes. The circuit could be improved by
* using a regulator with better noise rejection and an instrumentation amplifier for the filter, but this works
* okay (the sensor's output impedance is 100 ohms, so the circuit's output impedance is 1.1 kOhms, which is fine).
*/
#include "yaw.h"
#include <avr/io.h>
#include <avr/interrupt.h>
// TIMER_PERIOD is the number of timer cycles between timer ticks. The timer runs at 250 kHz (fck/64),
// so 250 ticks will take 1 ms. This means that the yaw sensor output is sampled at a frequency of 1 kHz,
// which is excessive considering that its filter has a corner frequency of 16 Hz. However, because the
// sensor output is unamplified, it needs to be sampled often in order to increase the software sensitivity
// of the accumulator. For example, if it samples at 1000 Hz then a 90 degree turn may produce an accumulator
// value around 13000 (this value depends on several factors and might not be correct); thus to obtain a
// reading in degrees you divide the accumulator by 145. If it samples at 100 Hz then a 90 degree turn would
// correspond to an accumulator value around 1300. You can't divide the accumulator by 14.5, you'd have to
// divide by 14 or 15 and lose the extra .5 of precision.
//
// So anyway, we could make the system more sensitive to small yaw rates by sampling at 100 Hz and applying a
// gain to the ADC input. That is, if we wanted to mess around with op-amps or differential inputs and DC
// blocking, which I don't.
#define TIMER_PERIOD 250
// The accumulator is divided by this value to produce a value in degrees.
#define DEGREE_CONVERSION_FACTOR 145
// the minimum number of matching readings for calibration
#define MIN_SUCCESSFUL_CALIBRATIONS 5
volatile YAW_SYSTEM_STATE state = YAW_IDLE;
volatile uint8_t successful_calibrations = 0;
volatile uint8_t adj = 0;
volatile int16_t accumulator = 0;
void Yaw_Init()
{
// select Aref as reference, enable left-adjust, and set MUX to channel 0.
ADMUX = _BV(ADLAR);
// enable ADC; enable auto-trigger, enable interrupt, set prescaler to fck/128 (125 kHz at 16 MHz clock)
ADCSRA = _BV(ADEN) | _BV(ADATE) | _BV(ADIE) | _BV(ADPS2) | _BV(ADPS1) | _BV(ADPS0);
// auto-trigger on timer 1B compare match
ADCSRB = _BV(ADTS2) | _BV(ADTS0);
// disable digital input pin corresponding to ADC0.
DIDR0 = _BV(ADC0D);
// This enables timer 1B running at fck/64 with the compare match interrupt triggering every 1 ms.
// The compare match triggers the ADC, so the interrupt is not enabled (it is handled in ADC_vect).
// The sonar module also uses timer 1, so if you change this configuration make sure that the
// change won't affect the sonar.
TCCR1A = 0;
OCR1B = TIMER_PERIOD;
TCNT1 = 0;
TCCR1B = _BV(CS11) | _BV(CS10); // start running timer at 250 kHz (16 MHz base).
}
void Yaw_StartAccumulating()
{
if (state == YAW_IDLE)
{
state = YAW_CALIBRATING;
}
else
{
// error? Or maybe just always move the state to CALIBRATING? Whatever.
}
}
void Yaw_WaitForCalibration()
{
while (state == YAW_CALIBRATING);
}
YAW_SYSTEM_STATE Yaw_GetState()
{
return state;
}
int16_t Yaw_GetDegrees()
{
// TODO: This algorithm could use some tuning, especially for small angles.
return accumulator / DEGREE_CONVERSION_FACTOR;
}
int16_t Yaw_StopAccumulating()
{
state = YAW_IDLE;
return Yaw_GetDegrees();
}
void Yaw_ResetAccumulator()
{
accumulator = 0;
}
// This interrupt is triggered when an ADC conversion completes. The conversion is started by the
// timer 1B interrupt (which does not have a handler, so it is maintained in this handler). If the
// system is in the CALIBRATING or ACCUMULATING states then the conversion result is applied respectively
// to the adjust variable or the accumulator, otherwise it is ignored.
ISR(ADC_vect)
{
uint8_t adj_temp;
// timer maintenance: clear timer interrupt flag and set next interrupt time for 1 ms hence
TIFR1 = _BV(OCF1B);
OCR1B += TIMER_PERIOD;
// the calibration routine takes samples until 5 in a row are equal
if (state == YAW_CALIBRATING)
{
adj_temp = ADCH;
if (adj_temp == adj)
{
successful_calibrations++;
}
else
{
successful_calibrations = 0;
}
adj = adj_temp;
if (successful_calibrations == MIN_SUCCESSFUL_CALIBRATIONS)
{
// adj will now hold the value representing 0 deg/s
state = YAW_ACCUMULATING;
successful_calibrations = 0;
}
}
else if (state == YAW_ACCUMULATING)
{
accumulator += ADCH;
accumulator -= adj;
}
else
{
// ignore conversion in other states
}
}
| [
"[email protected]@3c1b0362-c62b-8bf9-9a54-5033ff64f510"
] | [
[
[
1,
161
]
]
] |
78ddcd12c7c5ad4bde4c80d0f56a949719b94642 | 011359e589f99ae5fe8271962d447165e9ff7768 | /ps3/menu.cpp | 4b9a08354c0052c7f78dfcf15500e1e1144c43f4 | [] | no_license | PS3emulators/fba-next-slim | 4c753375fd68863c53830bb367c61737393f9777 | d082dea48c378bddd5e2a686fe8c19beb06db8e1 | refs/heads/master | 2021-01-17T23:05:29.479865 | 2011-12-01T18:16:02 | 2011-12-01T18:16:02 | 2,899,840 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 76,877 | cpp | #include <sysutil/sysutil_msgdialog.h>
#include <sysutil/sysutil_sysparam.h>
#include <cell/cell_fs.h>
#include <vector>
#include <algorithm>
#include <map>
#include "menu.h"
#include "burner.h"
#include "cellframework2/input/pad_input.h"
#include "audio_driver.h"
#include "vid_psgl.h"
#include "inp_keys.h"
#define FILEBROWSER_DELAY 90000
#define ALL 0
#define CPS1 1
#define CPS2 2
#define CPS3 3
#define NEOGEO 4
#define TAITO 5
#define SEGA 6
#define PGM 7
#define PSIKYO 8
#define KONAMI 9
#define KANEKO 10
#define CAVE 11
#define TOAPLAN 12
#define SEGAMD 13
#define MISC 14
#define MASKMISC (1 << (HARDWARE_PREFIX_MISC >> 24))
#define MASKCPS (1 << (HARDWARE_PREFIX_CPS1 >> 24))
#define MASKNEOGEO (1 << (HARDWARE_PREFIX_SNK >> 24))
#define MASKSEGA (1 << (HARDWARE_PREFIX_SEGA >> 24))
#define MASKTOAPLAN (1 << (HARDWARE_PREFIX_TOAPLAN >> 24))
#define MASKCAVE (1 << (HARDWARE_PREFIX_CAVE >> 24))
#define MASKCPS2 (1 << (HARDWARE_PREFIX_CPS2 >> 24))
#define MASKMD (1 << (HARDWARE_PREFIX_SEGAMD >> 24))
#define MASKPGM (1 << (HARDWARE_PREFIX_PGM >> 24))
#define MASKCPS3 (1 << (HARDWARE_PREFIX_CPS3 >> 24))
#define MASKTAITO (1 << (HARDWARE_PREFIX_TAITO >> 24))
#define MASKPSIKYO (1 << (HARDWARE_PREFIX_PSIKYO >> 24))
#define MASKKANEKO16 (1 << (HARDWARE_PREFIX_KANEKO16 >> 24))
#define MASKKONAMI (1 << (HARDWARE_PREFIX_KONAMI >> 24))
#define MASKPACMAN (1 << (HARDWARE_PREFIX_PACMAN >> 24))
#define MASKGALAXIAN (1 << (HARDWARE_PREFIX_GALAXIAN >> 24))
#define MASKATARI (1 << (HARDWARE_PREFIX_ATARI >> 24))
#define MASKALL \
(MASKMISC | MASKCPS | MASKNEOGEO | MASKSEGA | MASKTOAPLAN \
| MASKCAVE | MASKCPS2 | MASKMD | MASKPGM | MASKCPS3 \
| MASKTAITO | MASKPSIKYO | MASKKANEKO16 | MASKKONAMI | MASKPACMAN \
| MASKGALAXIAN | MASKATARI)
#define SCALING_FACTOR_LIMIT 5
#define MAX_SHADERS 2
#define KEY(x) pgi->nInput = GIT_SWITCH; pgi->Input.Switch = (unsigned short)(x);
/****************************************************/
/* PNG SECTION */
/****************************************************/
extern bool DoReset;
extern bool CheckSetting(int i);
unsigned int nPrevGame = ~0U;
static unsigned char nPrevDIPSettings[4];
static unsigned int nDIPGroup;
static unsigned int nDIPSel;
static unsigned int nInpSel;
static int nDIPOffset;
static uint64_t save_state_slot = 0;
std::map<std::string,std::string> m_DipList;
std::vector<std::string> m_DipListData;
std::vector<std::string> m_DipListValues;
std::vector<int> m_DipListOffsets;
std::map<std::string,std::string> m_InputList;
std::vector<std::string> m_InputListData;
std::vector<std::string> m_InputListValues;
std::vector<int> m_InputListOffsets;
std::map<int,std::string> m_InputSettingsList;
std::vector<std::string> m_InputSettingsData;
std::vector<std::string> m_InputSettingsValues;
char DipSetting[64];
char InpSetting[64];
bool dialog_is_running = false;
int CurrentFilter = 0;
int nLastRom = 0;
int nLastFilter = 0;
int HideChildren = 0;
int ThreeOrFourPlayerOnly = 0;
int _fd = 0;
// Rom List Movement
int iGameSelect;
int iCursorPos;
int iNumGames;
int m_iMaxWindowList;
int m_iWindowMiddle;
selected_shader_t selectedShader[MAX_SHADERS];
uint32_t shaderindex = 0;
uint32_t shaderindex2 = 0;
int currentConfigIndex = 0;
int inGameIndex = 0;
int inputListSel = 0;
int dipListSel = 0;
// Input Movement
int iInputSelect;
int iInputCursorPos;
int iNumInput;
int m_iMaxWindowListInput;
int m_iWindowMiddleInput;
int inputList = 0;
// DIP Movement
int iDipSelect;
int iDipCursorPos;
int iNumDips;
int m_iMaxWindowListDip;
int m_iWindowMiddleDip;
int dipList = 0;
#define GAMESEL_MaxWindowList 28
#define GAMESEL_WindowMiddle 14
#define COLS 0xFFFF7F7f
std::vector<std::string> m_ListData;
std::vector<std::string> m_ListShaderData;
std::vector<std::string> m_ListShader2Data;
std::vector<std::string> m_vecAvailRomIndex;
std::vector<std::string> m_vecAvailRomReleasedBy;
std::vector<std::string> m_vecAvailRomManufacturer;
std::vector<std::string> m_vecAvailRomInfo;
std::vector<std::string> m_vecAvailRomParent;
std::vector<std::int32_t> m_vecAvailRomBurnDrvIndex;
std::map<int, int> m_HardwareFilterMap;
std::map<int, std::string> m_HardwareFilterDesc;
std::vector<std::string> m_vecAvailRomList;
static int romsfound_count;
extern int GameStatus;
int StatedLoad(int nSlot)
{
int ret;
char szChoice[MAX_PATH];
sprintf(szChoice, "%s%s.%d.fs", SAVESTATES_DIR, BurnDrvGetTextA(DRV_NAME), nSlot);
ret = BurnStateLoad(szChoice, 1, &DrvInitCallback);
return ret;
}
int StatedSave(int nSlot)
{
int ret;
char szChoice[MAX_PATH];
sprintf(szChoice, "%s%s.%d.fs", SAVESTATES_DIR, BurnDrvGetTextA(DRV_NAME), nSlot);
ret = BurnStateSave(szChoice, 1);
return ret;
}
// DIP Switch Handler Code
static void InpDIPSWGetOffset()
{
BurnDIPInfo bdi;
nDIPOffset = 0;
for (int i = 0; BurnDrvGetDIPInfo(&bdi, i) == 0; i++)
{
if (bdi.nFlags == 0xF0)
{
nDIPOffset = bdi.nInput;
break;
}
}
}
void InpDIPSWResetDIPs()
{
int i = 0;
BurnDIPInfo bdi;
struct GameInp* pgi = NULL;
InpDIPSWGetOffset();
while (BurnDrvGetDIPInfo(&bdi, i) == 0)
{
if (bdi.nFlags == 0xFF)
{
pgi = GameInp + bdi.nInput + nDIPOffset;
if (pgi)
pgi->Input.Constant = (pgi->Input.Constant & ~bdi.nMask) | (bdi.nSetting & bdi.nMask);
}
i++;
}
}
bool CheckSetting(int i)
{
BurnDIPInfo bdi;
BurnDrvGetDIPInfo(&bdi, i);
struct GameInp* pgi = GameInp + bdi.nInput + nDIPOffset;
if (!pgi)
return false;
if ((pgi->Input.Constant & bdi.nMask) == bdi.nSetting)
{
unsigned char nFlags = bdi.nFlags;
if ((nFlags & 0x0F) <= 1)
return true;
else
{
for (int j = 1; j < (nFlags & 0x0F); j++)
{
BurnDrvGetDIPInfo(&bdi, i + j);
pgi = GameInp + bdi.nInput + nDIPOffset;
if (nFlags & 0x80)
{
if ((pgi->Input.Constant & bdi.nMask) == bdi.nSetting)
return false;
}
else
{
if ((pgi->Input.Constant & bdi.nMask) != bdi.nSetting)
return false;
}
}
return true;
}
}
return false;
}
// Make a list view of the DIPswitches
// do not refresh list every time, modified by regret
static int InpDIPSWListMake(bool bBuild)
{
return 0;
}
static int InpDIPSWInit()
{
return 0;
}
static int InpDIPSWExit()
{
return 0;
}
static void InpDIPSWCancel()
{
int i = 0, j = 0;
BurnDIPInfo bdi;
struct GameInp* pgi = NULL;
while (BurnDrvGetDIPInfo(&bdi, i) == 0)
{
if (bdi.nInput >= 0 && bdi.nFlags == 0xFF)
{
pgi = GameInp + bdi.nInput + nDIPOffset;
if (pgi)
{
pgi->Input.Constant = nPrevDIPSettings[j];
j++;
}
}
i++;
}
}
// Create the list of possible values for a DIPswitch
static void InpDIPSWSelect()
{
}
static void DIPSChanged(const int& id)
{
}
int InpDIPSWCreate()
{
return 0;
}
void LoadDIPS()
{
m_DipList.clear();
m_DipListData.clear();
m_DipListValues.clear();
m_DipListOffsets.clear();
BurnDIPInfo bdi;
unsigned int i = 0, j = 0, k = 0;
char* pDIPGroup = NULL;
while (BurnDrvGetDIPInfo(&bdi, i) == 0)
{
if ((bdi.nFlags & 0xF0) == 0xF0)
{
if (bdi.nFlags == 0xFE || bdi.nFlags == 0xFD)
{
pDIPGroup = (char*)bdi.szText;
k = i;
}
i++;
}
else
{
if(CheckSetting(i))
{
if (pDIPGroup)
{
m_DipList[std::string(pDIPGroup)] = std::string(bdi.szText);
m_DipListData.push_back(pDIPGroup);
m_DipListOffsets.push_back(k);
}
j++;
}
i += (bdi.nFlags & 0x0F);
}
}
iNumDips = m_DipListData.size();
if (iNumDips < GAMESEL_MaxWindowList)
{
m_iMaxWindowListDip = iNumDips;
m_iWindowMiddleDip = 0;
}
else
{
m_iMaxWindowListDip = GAMESEL_MaxWindowList;
m_iWindowMiddleDip = GAMESEL_WindowMiddle;
}
}
void LoadInputs()
{
unsigned int i, j = 0;
m_InputList.clear();
m_InputListData.clear();
m_InputListOffsets.clear();
// Add all the input names to the list
for (unsigned int i = 0; i < nGameInpCount; i++)
{
// Get the name of the input
struct BurnInputInfo bii;
bii.szName = NULL;
BurnDrvGetInputInfo(&bii, i);
// skip unused inputs
if (bii.pVal == NULL)
continue;
if (bii.szName == NULL)
bii.szName = "";
m_InputList[std::string(bii.szName)] = std::string(" ");
m_InputListData.push_back(std::string(bii.szName));
m_InputListOffsets.push_back(j);
j++;
}
struct GameInp* pgi = GameInp + nGameInpCount;
pgi = NULL;
// Update the values of all the inputs
int z = 0;
for (i = 0, pgi = GameInp; i < nGameInpCount; i++, pgi++)
{
if (pgi->Input.pVal == NULL)
continue;
BurnInputInfo bii;
bii.szName = NULL;
BurnDrvGetInputInfo(&bii, i);
// skip unused inputs
if (bii.pVal == NULL)
continue;
if (bii.szName == NULL)
bii.szName = "";
const char* pszVal = InpToDesc(pgi);
m_InputList[m_InputListData[z].c_str()] = std::string(pszVal);
j++;
z++;
}
iNumInput = m_InputListData.size();
if (iNumInput < GAMESEL_MaxWindowList)
{
m_iMaxWindowListInput = iNumInput;
m_iWindowMiddleInput = 0;
}
else
{
m_iMaxWindowListInput = GAMESEL_MaxWindowList;
m_iWindowMiddleInput = GAMESEL_WindowMiddle;
}
}
int InitDipList()
{
iDipSelect = 0;
iDipCursorPos = 0;
m_DipList.clear();
m_DipListData.clear();
m_DipListValues.clear();
m_DipListOffsets.clear();
}
int InitInputList()
{
iInputSelect = 0;
iInputCursorPos = 0;
m_InputSettingsList.clear();
m_InputSettingsData.clear();
m_InputSettingsList[CTRL_SQUARE_MASK] = std::string("Square Button");
m_InputSettingsList[CTRL_CROSS_MASK] = std::string("Cross Button");
m_InputSettingsList[CTRL_CIRCLE_MASK] = std::string("Circle Button");
m_InputSettingsList[CTRL_TRIANGLE_MASK] = std::string("Triangle Button");
m_InputSettingsList[CTRL_START_MASK] = std::string("Start Button");
m_InputSettingsList[CTRL_SELECT_MASK] = std::string("Select Button");
m_InputSettingsList[CTRL_L1_MASK] = std::string("L1 Button");
m_InputSettingsList[CTRL_R1_MASK] = std::string("R1 Button");
m_InputSettingsList[CTRL_L3_MASK] = std::string("L3 Button");
m_InputSettingsList[CTRL_R3_MASK] = std::string("R3 Button");
m_InputSettingsList[CTRL_L2_MASK] = std::string("L2 Button");
m_InputSettingsList[CTRL_R2_MASK] = std::string("R2 Button");
m_InputSettingsList[CTRL_R3_MASK | CTRL_L3_MASK] = std::string("L3 + R3");
m_InputSettingsData.push_back(std::string("Square Button"));
m_InputSettingsData.push_back(std::string("Cross Button"));
m_InputSettingsData.push_back(std::string("Circle Button"));
m_InputSettingsData.push_back(std::string("Triangle Button"));
m_InputSettingsData.push_back(std::string("Start Button"));
m_InputSettingsData.push_back(std::string("Select Button"));
m_InputSettingsData.push_back(std::string("L1 Button"));
m_InputSettingsData.push_back(std::string("R1 Button"));
m_InputSettingsData.push_back(std::string("L3 Button"));
m_InputSettingsData.push_back(std::string("R3 Button"));
m_InputSettingsData.push_back(std::string("L2 Button"));
m_InputSettingsData.push_back(std::string("R2 Button"));
m_InputSettingsData.push_back(std::string("L3 + R3"));
}
int InitRomList()
{
m_ListData.clear();
m_vecAvailRomList.clear();
m_vecAvailRomIndex.clear();
m_vecAvailRomBurnDrvIndex.clear();
iGameSelect = 0;
iCursorPos = 0;
// build the hardware filter map
m_HardwareFilterMap[ALL] = MASKALL;
m_HardwareFilterMap[CPS1] = MASKCPS;
m_HardwareFilterMap[CPS2] = MASKCPS2;
m_HardwareFilterMap[CPS3] = MASKCPS3;
m_HardwareFilterMap[NEOGEO] = MASKNEOGEO;
m_HardwareFilterMap[TAITO] = MASKTAITO;
m_HardwareFilterMap[SEGA] = MASKSEGA;
m_HardwareFilterMap[PGM] = MASKPGM;
m_HardwareFilterMap[PSIKYO] = MASKPSIKYO;
m_HardwareFilterMap[KONAMI] = MASKKONAMI;
m_HardwareFilterMap[KANEKO] = MASKKANEKO16;
m_HardwareFilterMap[CAVE] = MASKCAVE;
m_HardwareFilterMap[TOAPLAN] = MASKTOAPLAN;
m_HardwareFilterMap[SEGAMD] = MASKMD;
m_HardwareFilterMap[MISC] = MASKMISC;
m_HardwareFilterDesc[ALL] = "All Hardware";
m_HardwareFilterDesc[CPS1] = "Capcom CPS1";
m_HardwareFilterDesc[CPS2] = "Capcom CPS2";
m_HardwareFilterDesc[CPS3] = "Capcom CPS3";
m_HardwareFilterDesc[NEOGEO] = "NeoGeo";
m_HardwareFilterDesc[TAITO] = "Taito";
m_HardwareFilterDesc[SEGA] = "Sega System 16";
m_HardwareFilterDesc[PGM] = "PGM";
m_HardwareFilterDesc[PSIKYO] = "Psikyo";
m_HardwareFilterDesc[KONAMI] = "Konami";
m_HardwareFilterDesc[KANEKO] = "Kaneko 16";
m_HardwareFilterDesc[CAVE] = "Cave";
m_HardwareFilterDesc[TOAPLAN] = "Toaplan";
m_HardwareFilterDesc[SEGAMD] = "Sega Megadrive";
m_HardwareFilterDesc[MISC] = "Misc";
return 0;
}
static int AvRoms()
{
iNumGames = m_vecAvailRomList.size();
if (iNumGames < GAMESEL_MaxWindowList)
{
m_iMaxWindowList = iNumGames;
m_iWindowMiddle = iNumGames/2;
}
else
{
m_iMaxWindowList = GAMESEL_MaxWindowList;
m_iWindowMiddle = GAMESEL_WindowMiddle;
}
return 0;
}
#define iterate_directory(rompath, array) \
if (cellFsOpendir(rompath, &_fd) == CELL_FS_SUCCEEDED) \
{ \
CellFsDirent dirent; \
uint64_t nread = 0; \
while (cellFsReaddir(_fd, &dirent, &nread) == CELL_FS_SUCCEEDED) \
{ \
if (nread == 0) \
break; \
if (dirent.d_type == CELL_FS_TYPE_REGULAR) \
{ \
array.push_back(dirent.d_name); \
romsfound_count++; \
} \
} \
cellFsClosedir(_fd); \
}
int FetchRoms()
{
if (m_ListData.empty())
{
for (int d = 0; d < DIRS_MAX; d++)
{
if (!strcasecmp(szAppRomPaths[d], ""))
continue; // skip empty path
iterate_directory(szAppRomPaths[d], m_ListData);
}
if(romsfound_count)
std::sort(m_ListData.begin(), m_ListData.end());
}
return romsfound_count;
}
void BuildRomList()
{
bool IsFiltered = false;
std::vector<std::string> vecTempRomList;
std::vector<std::string> vecAvailRomListFileName;
std::vector<std::string> vecAvailRomList;
std::vector<int> vecAvailRomIndex;
m_vecAvailRomList.clear();
m_vecAvailRomReleasedBy.clear();
m_vecAvailRomInfo.clear();
m_vecAvailRomParent.clear();
m_vecAvailRomManufacturer.clear();
m_vecAvailRomIndex.clear();
m_vecAvailRomBurnDrvIndex.clear();
iGameSelect = 0;
iCursorPos = 0;
//shader #1
if (m_ListShaderData.empty())
{
if (cellFsOpendir(SHADER_DIRECTORY, &_fd) == CELL_FS_SUCCEEDED)
{
CellFsDirent dirent;
uint64_t nread = 0;
while (cellFsReaddir(_fd, &dirent, &nread) == CELL_FS_SUCCEEDED)
{
if (nread == 0)
break;
if (dirent.d_type == CELL_FS_TYPE_REGULAR)
{
if(strstr(dirent.d_name,".cg") || strstr(dirent.d_name,".CG"))
m_ListShaderData.push_back(dirent.d_name);
}
else
continue;
}
cellFsClosedir(_fd);
}
std::sort(m_ListShaderData.begin(), m_ListShaderData.end());
for (unsigned int x = 0; x < m_ListShaderData.size(); x++)
{
if(strcmp(selectedShader[0].filename,m_ListShaderData[x].c_str()) == 0)
{
shaderindex = selectedShader[0].index = x;
sprintf(selectedShader[0].fullpath, "%s%s", SHADER_DIRECTORY, m_ListShaderData[x].c_str());
break;
}
}
}
//shader #2
if (m_ListShader2Data.empty())
{
if (cellFsOpendir(SHADER_DIRECTORY, &_fd) == CELL_FS_SUCCEEDED)
{
CellFsDirent dirent;
uint64_t nread = 0;
while (cellFsReaddir(_fd, &dirent, &nread) == CELL_FS_SUCCEEDED)
{
if (nread == 0)
break;
if (dirent.d_type == CELL_FS_TYPE_REGULAR)
{
if(strstr(dirent.d_name,".cg") || strstr(dirent.d_name,".CG"))
m_ListShader2Data.push_back(dirent.d_name);
}
else
continue;
}
cellFsClosedir(_fd);
}
std::sort(m_ListShader2Data.begin(), m_ListShader2Data.end());
for (unsigned int x = 0; x < m_ListShader2Data.size(); x++)
{
if(strcmp(selectedShader[1].filename,m_ListShader2Data[x].c_str()) == 0)
{
shaderindex2 = selectedShader[1].index = x;
sprintf(selectedShader[1].fullpath, "%s%s", SHADER_DIRECTORY, m_ListShader2Data[x].c_str());
break;
}
}
}
// Now build a vector of Burn Roms
unsigned int i = 0;
if(romsfound_count)
{
do
{
nBurnDrvSelect = i;
char *szName;
BurnDrvGetArchiveName(&szName, 0);
vecAvailRomListFileName.push_back(szName);
vecAvailRomList.push_back(BurnDrvGetTextA(DRV_FULLNAME));
vecAvailRomIndex.push_back(i);
i++;
}while(i < nBurnDrvCount-1);
// For each *.zip we have, see if there is a matching burn rom
// if so add it to the m_vec members and we are done.
for (unsigned int x = 0; x < vecAvailRomListFileName.size(); x++)
{
for (unsigned int y = 0; y < m_ListData.size(); y++)
{
if (m_ListData[y] == vecAvailRomListFileName[x])
{
nBurnDrvSelect = vecAvailRomIndex[x];
const int nHardware = 1 << (BurnDrvGetHardwareCode() >> 24);
if (CurrentFilter > 0)
IsFiltered = (nHardware) == m_HardwareFilterMap[CurrentFilter];
else
IsFiltered = true;
if ((IsFiltered)) // skip roms marked as not working
if (BurnDrvIsWorking() && (IsFiltered)) // skip roms marked as not working
{
int nNumPlayers = BurnDrvGetMaxPlayers();
if ((HideChildren == 1 && (BurnDrvGetTextA(DRV_PARENT) == NULL && !(BurnDrvGetFlags() & BDF_CLONE))) || (HideChildren == 1 && (BurnDrvGetHardwareCode() & HARDWARE_PUBLIC_MASK) == HARDWARE_CAPCOM_CPS3) || (HideChildren == 0))
{
if ((ThreeOrFourPlayerOnly == 1 && nNumPlayers > 2) || ThreeOrFourPlayerOnly == 0)
{
m_vecAvailRomIndex.push_back(vecAvailRomListFileName[x]);
m_vecAvailRomBurnDrvIndex.push_back(vecAvailRomIndex[x]);
m_vecAvailRomList.push_back(BurnDrvGetTextA(DRV_FULLNAME));
m_vecAvailRomReleasedBy.push_back(BurnDrvGetTextA(DRV_MANUFACTURER));
if (BurnDrvGetTextA(DRV_SYSTEM))
m_vecAvailRomManufacturer.push_back(BurnDrvGetTextA(DRV_SYSTEM));
else
m_vecAvailRomManufacturer.push_back("Unknown");
if (BurnDrvGetTextA(DRV_COMMENT))
m_vecAvailRomInfo.push_back(BurnDrvGetTextA(DRV_COMMENT));
else
m_vecAvailRomInfo.push_back("No Additional Information");
if (BurnDrvGetTextA(DRV_PARENT))
m_vecAvailRomParent.push_back(BurnDrvGetTextA(DRV_PARENT));
else
m_vecAvailRomParent.push_back("No Parent Rom");
}
}
}
break;
}
}
}
}
AvRoms();
//nBurnDrvSelect = ~0U;
}
void ConfigMenu()
{
cellDbgFontPuts(0.05f, 0.04f , 0.75f, 0xFFE0EEFF, "FBANext PS3 - Configuration Menu");
cellDbgFontDraw();
if (bDrvOkay)
cellDbgFontPrintf(0.6f, 0.90f + 0.025f, 0.75f, 0xFF805EFF ,"Circle - Return to Game");
else
cellDbgFontPuts(0.6f, 0.90f + 0.025f, 0.75f, 0xFFE0EEFF ,"Circle - Back to Main Menu");
cellDbgFontPuts(0.6f, 0.92f + 0.025f, 0.75f, 0xFFE0EEFF ,"Triangle - Generate CLRMAME.DAT");
cellDbgFontDraw();
int number = 0;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_DISPLAY_FRAMERATE ? COLS : 0xFFFFFFFF, "Show Framerate : %s", bShowFPS ? "Yes" : "No" );
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_SOUND_SAMPLERATE ? COLS : 0xFFFFFFFF, "Sound Samplerate : %d", bAudSetSampleRate);
cellDbgFontDraw();
number++;
switch(psglGetCurrentResolutionId())
{
case CELL_VIDEO_OUT_RESOLUTION_480:
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_RESOLUTION ? COLS : 0xFFFFFFFF, "Resolution : 720x480 (480p)");
break;
case CELL_VIDEO_OUT_RESOLUTION_720:
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_RESOLUTION ? COLS : 0xFFFFFFFF, "Resolution : 1280x720 (720p)");
break;
case CELL_VIDEO_OUT_RESOLUTION_1080:
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_RESOLUTION ? COLS : 0xFFFFFFFF, "Resolution : 1920x1080 (1080p)");
break;
case CELL_VIDEO_OUT_RESOLUTION_576:
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_RESOLUTION ? COLS : 0xFFFFFFFF, "Resolution : 720x576 (576p)");
break;
case CELL_VIDEO_OUT_RESOLUTION_1600x1080:
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_RESOLUTION ? COLS : 0xFFFFFFFF, "Resolution : 1600x1080");
break;
case CELL_VIDEO_OUT_RESOLUTION_1440x1080:
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_RESOLUTION ? COLS : 0xFFFFFFFF, "Resolution : 1440x1080");
break;
case CELL_VIDEO_OUT_RESOLUTION_1280x1080:
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_RESOLUTION ? COLS : 0xFFFFFFFF, "Resolution : 1280x1080");
break;
case CELL_VIDEO_OUT_RESOLUTION_960x1080:
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_RESOLUTION ? COLS : 0xFFFFFFFF, "Resolution : 960x1080");
break;
}
cellDbgFontDraw();
number++;
char msg[256];
switch(nVidScrnAspectMode)
{
case ASPECT_RATIO_CUSTOM:
strcpy(msg,"Custom (Resized)");
break;
case ASPECT_RATIO_AUTO:
sprintf(msg,"Auto %d:%d", nVidScrnAspectX, nVidScrnAspectY);
break;
case ASPECT_RATIO_AUTO_FBA:
sprintf(msg,"Auto (FBA) %d:%d", nVidScrnAspectX, nVidScrnAspectY);
break;
default:
sprintf(msg,"%d:%d", nVidScrnAspectX, nVidScrnAspectY);
break;
}
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_KEEP_ASPECT ? COLS : 0xFFFFFFFF, "Aspect Ratio : %s", msg);
cellDbgFontDraw();
number++;
char rotatemsg[3][256] = {{"Rotate for Vertical Games"},{"Do not rotate for Vertical Games"},{"Reverse flipping for vertical games"}};
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_ROTATE ? COLS : 0xFFFFFFFF, "Rotation Adjust: %s", rotatemsg[nVidRotationAdjust]);
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_FBO_ENABLED ? COLS : 0xFFFFFFFF, "Custom Scaling/Dual Shaders: %s", bVidFBOEnabled ? "Yes" : "No");
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_CURRENT_SHADER ? COLS : 0xFFFFFFFF, "Current Shader #1: %s", m_ListShaderData[shaderindex].c_str());
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_CURRENT_SHADER2 ? COLS : 0xFFFFFFFF, "Current Shader #2: %s", m_ListShader2Data[shaderindex2].c_str());
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_BILINEAR_FILTER ? COLS : 0xFFFFFFFF, "Hardware Filter Shader #1: %s", vidFilterLinear ? "Linear" : "Point");
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_BILINEAR_FILTER2 ? COLS : 0xFFFFFFFF, "Hardware Filter Shader #2: %s", vidFilterLinear2 ? "Linear" : "Point");
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_SCALING_FACTOR ? COLS : 0xFFFFFFFF, "Scaling Factor: %dx", bVidScalingFactor);
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_OVERSCAN ? COLS : 0xFFFFFFFF, "Overscan: %f", m_overscan_amount);
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_VSYNC ? COLS : 0xFFFFFFFF, "Vertical Sync : %s", bVidVSync ? "Yes" : "No");
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_HIDE_CLONES ? COLS : 0xFFFFFFFF, "Hide Clone Roms : %s", HideChildren ? "Yes" : "No");
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_SHOW_THREE_FOUR_PLAYER_ONLY ? COLS : 0xFFFFFFFF, "Show 3 or 4 Player Roms Only : %s", ThreeOrFourPlayerOnly ? "Yes" : "No");
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, currentConfigIndex == SETTING_TRIPLE_BUFFER ? COLS : 0xFFFFFFFF, "Triple Buffering Enabled : %s", bVidTripleBuffer ? "Yes" : "No");
cellDbgFontDraw();
cellDbgFontPrintf(0.05f, 0.92f + 0.025f, 0.50f, 0xFFFFE0E0, "Core %s - r%s - %s", szAppBurnVer, szSVNVer, szSVNDate);
cellDbgFontDraw();
}
static void cb_dialog_ok(int button_type, void *userdata)
{
switch(button_type)
{
case CELL_MSGDIALOG_BUTTON_ESCAPE:
dialog_is_running = false;
break;
}
}
void ConfigFrameMove()
{
static uint64_t old_state = 0;
uint64_t new_state = cell_pad_input_poll_device(0);
uint64_t diff_state = old_state ^ new_state;
if (CTRL_CIRCLE(new_state))
{
// switch to config
old_state = new_state;
if (bDrvOkay) // theres a game loaded, return to game
{
audio_play();
GameStatus = EMULATING;
return;
}
else
GameStatus = MENU; // back to romlist
}
else if (CTRL_TRIANGLE(old_state & diff_state))
{
// switch to config
UpdateConsoleXY("Generating clrmame.dat. Please wait...", 0.35f, 0.5f );
if (create_datfile(DAT_FILE,0) == 0)
{
dialog_is_running = true;
cellMsgDialogOpen2(CELL_MSGDIALOG_DIALOG_TYPE_NORMAL| \
CELL_MSGDIALOG_TYPE_BG_VISIBLE| \
CELL_MSGDIALOG_TYPE_BUTTON_TYPE_NONE|CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_OFF|\
CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_OK,\
"clrmame.dat created in /dev_hdd0/game/FBAN00000/USRDIR/.",cb_dialog_ok,NULL,NULL);
while(dialog_is_running)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
psglSwap();
cellSysutilCheckCallback();
}
}
else
{
dialog_is_running = true;
cellMsgDialogOpen2(CELL_MSGDIALOG_TYPE_SE_TYPE_ERROR| \
CELL_MSGDIALOG_TYPE_BG_VISIBLE| \
CELL_MSGDIALOG_TYPE_BUTTON_TYPE_NONE|CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_OFF|\
CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_OK,\
"Error generating clrmame.dat.",cb_dialog_ok,NULL,NULL);
while(dialog_is_running)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
psglSwap();
cellSysutilCheckCallback();
}
}
}
else if(CTRL_DOWN(new_state & diff_state) | CTRL_R2(new_state) | CTRL_LSTICK_DOWN(new_state))
{
sys_timer_usleep(FILEBROWSER_DELAY);
currentConfigIndex++;
if (currentConfigIndex >= MAX_NO_OF_SETTINGS)
currentConfigIndex = MAX_NO_OF_SETTINGS-1;
}
else if(CTRL_UP(new_state & diff_state) | CTRL_L2(new_state) | CTRL_LSTICK_UP(new_state))
{
sys_timer_usleep(FILEBROWSER_DELAY);
currentConfigIndex--;
if (currentConfigIndex < 0)
currentConfigIndex = 0;
}
switch(currentConfigIndex)
{
case SETTING_DISPLAY_FRAMERATE:
if(CTRL_LEFT(new_state & diff_state) | CTRL_RIGHT(new_state & diff_state) | CTRL_CROSS(old_state & diff_state))
{
bShowFPS = !bShowFPS;
}
break;
case SETTING_RESOLUTION:
if(CTRL_LEFT(new_state & diff_state) | CTRL_LSTICK_LEFT(new_state))
{
psglResolutionPrevious();
sys_timer_usleep(FILEBROWSER_DELAY);
}
if(CTRL_RIGHT(new_state & diff_state) | CTRL_LSTICK_RIGHT(new_state))
{
psglResolutionNext();
sys_timer_usleep(FILEBROWSER_DELAY);
}
if(CTRL_CROSS(old_state & diff_state))
{
psglResolutionSwitch();
}
break;
case SETTING_SOUND_SAMPLERATE:
{
if(CTRL_LEFT(new_state & diff_state) | CTRL_LSTICK_LEFT(new_state))
{
switch(bAudSetSampleRate)
{
case 11025:
break;
case 22050:
bAudSetSampleRate = 11025;
bAudReinit = true;
break;
case 44010:
bAudSetSampleRate = 22050;
bAudReinit = true;
break;
case 48010:
bAudSetSampleRate = 44010;
bAudReinit = true;
break;
}
}
if(CTRL_RIGHT(new_state & diff_state) | CTRL_LSTICK_RIGHT(new_state))
{
switch(bAudSetSampleRate)
{
case 11025:
bAudSetSampleRate = 22050;
bAudReinit = true;
break;
case 22050:
bAudSetSampleRate = 44010;
bAudReinit = true;
break;
case 44010:
bAudSetSampleRate = 48010;
bAudReinit = true;
break;
case 48010:
break;
}
}
break;
}
case SETTING_KEEP_ASPECT:
if(CTRL_LEFT(new_state & diff_state))
{
if(nVidScrnAspectMode > 0)
{
nVidScrnAspectMode--;
setWindowAspect(0);
}
}
else if(CTRL_RIGHT(new_state & diff_state) | CTRL_CROSS(old_state & diff_state))
{
if(nVidScrnAspectMode < LAST_ASPECT_RATIO)
{
nVidScrnAspectMode++;
setWindowAspect(0);
}
}
break;
case SETTING_ROTATE:
if(CTRL_LEFT(new_state & diff_state) | CTRL_RIGHT(new_state & diff_state) | CTRL_CROSS(old_state & diff_state))
{
nVidRotationAdjust++;
if (nVidRotationAdjust > 2)
{
nVidRotationAdjust = 0;
}
//apply_rotation_settings();
}
break;
case SETTING_FBO_ENABLED:
if(CTRL_LEFT(new_state & diff_state) | CTRL_RIGHT(new_state & diff_state) | CTRL_CROSS(old_state & diff_state))
bVidFBOEnabled = !bVidFBOEnabled;
if(CTRL_CROSS(old_state & diff_state))
{
//FBO mode needs to be applied here
//Screen reinited
}
break;
case SETTING_CURRENT_SHADER:
if(CTRL_LEFT(new_state & diff_state) | CTRL_LSTICK_LEFT(new_state))
{
if(shaderindex > 0)
shaderindex--;
}
if(CTRL_RIGHT(new_state & diff_state) | CTRL_LSTICK_RIGHT(new_state))
{
if(shaderindex < m_ListShaderData.size()-1)
shaderindex ++;
}
if(CTRL_CROSS(old_state & diff_state))
{
selectedShader[0].index = shaderindex;
strcpy(selectedShader[0].filename, m_ListShaderData[shaderindex].c_str());
sprintf(selectedShader[0].fullpath, "%s%s", SHADER_DIRECTORY,m_ListShaderData[shaderindex].c_str());
psglInitShader(selectedShader[0].fullpath, 0);
}
break;
case SETTING_CURRENT_SHADER2:
if(CTRL_LEFT(new_state & diff_state) | CTRL_LSTICK_LEFT(new_state))
{
if(shaderindex2 > 0)
shaderindex2--;
}
if(CTRL_RIGHT(new_state & diff_state) | CTRL_LSTICK_RIGHT(new_state))
{
if(shaderindex2 < m_ListShader2Data.size()-1)
shaderindex2++;
}
if(CTRL_CROSS(old_state & diff_state))
{
selectedShader[1].index = shaderindex2;
strcpy(selectedShader[1].filename, m_ListShader2Data[shaderindex2].c_str());
sprintf(selectedShader[1].fullpath, "%s%s", SHADER_DIRECTORY,m_ListShader2Data[shaderindex2].c_str());
psglInitShader(selectedShader[1].fullpath, 1);
}
break;
case SETTING_BILINEAR_FILTER:
if(CTRL_LEFT(new_state & diff_state) | CTRL_RIGHT(new_state & diff_state) | CTRL_CROSS(old_state & diff_state))
vidFilterLinear = !vidFilterLinear;
break;
case SETTING_BILINEAR_FILTER2:
if(CTRL_LEFT(new_state & diff_state) | CTRL_RIGHT(new_state & diff_state) | CTRL_CROSS(old_state & diff_state))
vidFilterLinear2 = !vidFilterLinear2;
break;
case SETTING_SCALING_FACTOR:
if(CTRL_LEFT(new_state & diff_state) | CTRL_LSTICK_LEFT(new_state))
{
if(bVidScalingFactor > 1)
bVidScalingFactor--;
}
if(CTRL_RIGHT(new_state & diff_state) | CTRL_LSTICK_RIGHT(new_state))
{
if(bVidScalingFactor < SCALING_FACTOR_LIMIT)
bVidScalingFactor++;
}
if(CTRL_CROSS(old_state & diff_state))
{
//apply scale here, and reapply FBO if activated
//reapply screen here
BurnReinitScrn();
VidFrame();
}
break;
case SETTING_OVERSCAN:
if(CTRL_LEFT(new_state & diff_state) | CTRL_LSTICK_LEFT(new_state))
{
if(m_overscan_amount == 0.0f)
m_overscan = false;
else
m_overscan = true;
m_overscan_amount -= 0.01f;
CalculateViewports();
glSetViewports();
}
if(CTRL_RIGHT(new_state & diff_state) | CTRL_LSTICK_RIGHT(new_state))
{
if(m_overscan_amount == 0.0f)
m_overscan = false;
else
m_overscan = true;
m_overscan_amount += 0.01f;
CalculateViewports();
glSetViewports();
}
if(CTRL_START(old_state & diff_state))
{
m_overscan = false;
m_overscan_amount = 0.0f;
CalculateViewports();
glSetViewports();
}
break;
case SETTING_VSYNC:
if(CTRL_LEFT(new_state & diff_state) | CTRL_RIGHT(new_state & diff_state) | CTRL_CROSS(old_state & diff_state))
{
bVidVSync = !bVidVSync;
psglSetVSync(bVidVSync);
}
break;
case SETTING_HIDE_CLONES:
if(CTRL_LEFT(new_state & diff_state) | CTRL_RIGHT(new_state & diff_state) | CTRL_CROSS(old_state & diff_state))
HideChildren = !HideChildren;
break;
case SETTING_SHOW_THREE_FOUR_PLAYER_ONLY:
if(CTRL_LEFT(new_state & diff_state) | CTRL_RIGHT(new_state & diff_state) | CTRL_CROSS(old_state & diff_state))
ThreeOrFourPlayerOnly = !ThreeOrFourPlayerOnly;
break;
case SETTING_TRIPLE_BUFFER:
if(CTRL_LEFT(new_state & diff_state) | CTRL_RIGHT(new_state & diff_state) | CTRL_CROSS(old_state & diff_state))
{
bVidTripleBuffer = !bVidTripleBuffer; // we need to reset the context if we toggle tripple buffering
psglResolutionSwitch();
}
break;
}
ConfigMenu();
old_state = new_state;
}
void RomMenu()
{
#ifdef CELL_DEBUG_MEMORY
sys_memory_info_t mem_info;
#endif
int iTempGameSel;
int iGameidx;
// draw game list entries
iTempGameSel = iGameSelect;
#ifdef CELL_DEBUG_MEMORY
sys_memory_get_user_memory_size(&mem_info);
#endif
cellDbgFontPuts(0.05f, 0.04f , 0.75f, 0xFFE0EEFF, "FBANext PS3 - Main Menu");
cellDbgFontDraw();
cellDbgFontPrintf(0.6f, 0.04f, 0.75f, 0xFFE0EEFF, "Current Hardware : %s", m_HardwareFilterDesc[CurrentFilter].c_str());
cellDbgFontDraw();
cellDbgFontPuts(0.6f, 0.06f, 0.75f, 0xFFE0EEFF ,"L1/R1 - Previous/Next Hardware Filter");
cellDbgFontDraw();
if (!iNumGames)
{
cellDbgFontPrintf(0.05f, 0.08f, 0.75f, COLS, "No ROMs found in directory: %s\n", szAppRomPaths[0]);
cellDbgFontDraw();
}
else
{
iGameidx = 0;
do
{
if (iGameidx==iCursorPos)
{
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)iGameidx ), 0.75f, COLS, m_vecAvailRomList[iTempGameSel++].c_str());
cellDbgFontDraw();
cellDbgFontPuts(0.6f, 0.80f + 0.025f, 0.75f, 0xFFE0EEFF ,"Select - Options Menu");
cellDbgFontDraw();
cellDbgFontPrintf(0.6f, 0.82f + 0.025f, 0.75f, 0xFFE0EEFF ,"X - Load ROM");
cellDbgFontDraw();
if (bDrvOkay)
{
cellDbgFontPrintf(0.6f, 0.90f + 0.025f, 0.75f, 0xFF805EFF ,"Circle - Return to Game");
cellDbgFontDraw();
cellDbgFontPrintf(0.6f, 0.88f + 0.025f, 0.75f, 0xFF805EFF ,"Start - Exit Rom");
cellDbgFontDraw();
}
#ifdef CELL_DEBUG_MEMORY
cellDbgFontPrintf(0.75f, 0.90f + 0.025f, 0.75f, COLS ,"%ld free memory",mem_info.available_user_memory );
cellDbgFontDraw();
cellDbgFontPrintf(0.75f, 0.92f + 0.025f, 0.75f, COLS ,"%ld total memory",mem_info.total_user_memory );
cellDbgFontDraw();
cellDbgFontPrintf(0.75f, 0.95f + 0.025f, 0.75f, COLS ,"BurnDrvSelect = %ld ", m_vecAvailRomBurnDrvIndex[iGameSelect+iCursorPos]);
cellDbgFontDraw();
#endif
cellDbgFontPrintf(0.05f, 0.80f + 0.025f, 0.75f, 0xFFFFE0E0, "ROM Name : %s", m_vecAvailRomIndex[iGameSelect+iCursorPos].c_str() );
cellDbgFontDraw();
cellDbgFontPrintf(0.05f, 0.82f + 0.025f, 0.75f, 0xFFFFE0E0, "ROM Info : %s", m_vecAvailRomInfo[iGameSelect+iCursorPos].c_str());
cellDbgFontDraw();
cellDbgFontPrintf(0.05f, 0.84f + 0.025f, 0.75f, 0xFFFFE0E0, "Hardware : %s", m_vecAvailRomManufacturer[iGameSelect+iCursorPos].c_str() );
cellDbgFontDraw();
cellDbgFontPrintf(0.05f, 0.86f + 0.025f, 0.75f, 0xFFFFE0E0, "Released by : %s", m_vecAvailRomReleasedBy[iGameSelect+iCursorPos].c_str());
cellDbgFontDraw();
cellDbgFontPrintf(0.05f, 0.88f + 0.025f, 0.75f, 0xFFFFE0E0, "Parent ROM : %s", m_vecAvailRomParent[iGameSelect+iCursorPos].c_str());
cellDbgFontDraw();
cellDbgFontPrintf(0.05f, 0.92f + 0.025f, 0.50f, 0xFFFFE0E0, "Core %s - r%s - %s", szAppBurnVer, szSVNVer, szSVNDate);
cellDbgFontDraw();
cellDbgFontPuts(0.6f, 0.84f + 0.025f , 0.75f, 0xFFE0EEFF, "Triangle - Hide Clone Roms");
cellDbgFontDraw();
cellDbgFontPuts(0.6f, 0.86f + 0.025f , 0.75f, 0xFFE0EEFF, "Square - Show 3 or 4 Player Roms Only");
cellDbgFontDraw();
}
else
{
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)iGameidx), 0.75f, 0xFFFFFFFF, m_vecAvailRomList[iTempGameSel++].c_str());
cellDbgFontDraw();
}
iGameidx++;
}while(iGameidx<m_iMaxWindowList);
}
}
void DipFrameMove()
{
static uint64_t old_state = 0;
uint64_t new_state = cell_pad_input_poll_device(0);
uint64_t diff_state = old_state ^ new_state;
if (CTRL_CIRCLE(new_state & diff_state))
{
// switch to dip list
if (!dipList)
{
if (bDrvOkay) // theres a game loaded, return to game
{
audio_play();
is_running = 1;
GameStatus = EMULATING;
old_state = new_state;
return;
}
}
else
dipList = 0;
}
else if (CTRL_CROSS(new_state & diff_state))
{
if (!dipList)
{
dipListSel = 0;
dipList = 1;
int nSel = iDipCursorPos;
m_DipListValues.clear();
if (nSel >= 0)
{
if (m_DipListOffsets.size() > 0)
{
nDIPGroup = m_DipListOffsets[iDipSelect + iDipCursorPos];
BurnDIPInfo bdiGroup;
BurnDrvGetDIPInfo(&bdiGroup, nDIPGroup);
int nCurrentSetting = 0;
for (int i = 0, j = 0; i < bdiGroup.nSetting; i++)
{
char szText[MAX_PATH];
BurnDIPInfo bdi;
do {
BurnDrvGetDIPInfo(&bdi, nDIPGroup + 1 + j++);
} while (bdi.nFlags == 0);
if (bdiGroup.szText)
sprintf(szText, "%hs: %hs", bdiGroup.szText, bdi.szText);
else
sprintf(szText, "%hs", bdi.szText);
m_DipListValues.push_back(std::string(szText));
if(CheckSetting(nDIPGroup + j))
nCurrentSetting = i;
}
}
}
old_state = new_state;
return;
}
else
{
int id = dipListSel;
BurnDIPInfo bdi = {0, 0, 0, 0, NULL};
int j = 0;
for (int i = 0; i <= id; i++)
{
do {
BurnDrvGetDIPInfo(&bdi, nDIPGroup + 1 + j++);
} while (bdi.nFlags == 0);
}
struct GameInp* pgi = GameInp + bdi.nInput + nDIPOffset;
pgi->Input.Constant = (pgi->Input.Constant & ~bdi.nMask) | (bdi.nSetting & bdi.nMask);
if (bdi.nFlags & 0x40)
{
while (BurnDrvGetDIPInfo(&bdi, nDIPGroup + 1 + j++) == 0)
{
if (bdi.nFlags == 0)
{
pgi = GameInp + bdi.nInput + nDIPOffset;
pgi->Input.Constant = (pgi->Input.Constant & ~bdi.nMask) | (bdi.nSetting & bdi.nMask);
}
else
break;
}
}
LoadDIPS();
dipList = 0;
old_state = new_state;
return;
}
}
else if(CTRL_DOWN(new_state & diff_state) | CTRL_R2(new_state) | CTRL_LSTICK_DOWN(new_state))
{
if (!dipList)
{
// default don`t clamp cursor
bool bClampCursor = FALSE;
iDipCursorPos ++;
if( iDipCursorPos > m_iWindowMiddleDip )
{
// clamp cursor position
bClampCursor = TRUE;
// advance gameselect
if(iDipSelect == 0) iDipSelect += (iDipCursorPos - m_iWindowMiddleDip);
else iDipSelect ++;
// clamp game window range (high)
if((iDipSelect + m_iMaxWindowListDip) > iNumDips)
{
// clamp to end
iDipSelect = iNumDips - m_iMaxWindowListDip;
// advance cursor pos after all!
bClampCursor = FALSE;
// clamp cursor to end
if((iDipSelect + iDipCursorPos) >= iNumDips)
iDipCursorPos = m_iMaxWindowListDip-1;
}
}
// check for cursor clamp
if(bClampCursor)
iDipCursorPos = m_iWindowMiddleDip;
}
else
{
dipListSel++;
if (dipListSel > m_DipListValues.size()-1)
dipListSel = m_DipListValues.size()-1;
}
}
else if(CTRL_UP(new_state & diff_state) | CTRL_L2(new_state) | CTRL_LSTICK_UP(new_state))
{
if (!dipList)
{
// default don`t clamp cursor
bool bClampCursor = FALSE;
iDipCursorPos --;
if( iDipCursorPos < m_iWindowMiddleDip )
{
// clamp cursor position
bClampCursor = TRUE;
// backup window pos
iDipSelect --;
// clamp game window range (low)
if(iDipSelect < 0)
{
// clamp to start
iDipSelect = 0;
// backup cursor pos after all!
bClampCursor = FALSE;
// clamp cursor to end
if( iDipCursorPos < 0 )
iDipCursorPos = 0;
}
}
// check for cursor clamp
if( bClampCursor )
iDipCursorPos = m_iWindowMiddleDip;
}
else
{
dipListSel--;
if (dipListSel < 0)
dipListSel = 0;
}
}
else if (CTRL_SQUARE(old_state & diff_state))
{
InpDIPSWResetDIPs();
LoadDIPS();
}
old_state = new_state;
}
void DipMenu()
{
int i;
int iTempDipSel;
int iDipidx;
// draw input list entries
iTempDipSel = iDipSelect;
cellDbgFontPuts(0.05f, 0.04f , 0.75f, 0xFFE0EEFF, "FBANext PS3 - DIP Switch Menu");
cellDbgFontDraw();
for(iDipidx=0; iDipidx < m_iMaxWindowListDip; iDipidx++)
{
int val = iTempDipSel++;
sprintf(DipSetting,"%s : %s", m_DipListData[val].c_str(), m_DipList[std::string((char *)m_DipListData[val].c_str())].c_str());
if (iDipidx==iDipCursorPos)
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)iDipidx ), 0.75f, COLS, DipSetting);
else
{
if (dipList)
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)iDipidx ), 0.75f, 0xA0A0A0A0, DipSetting);
else
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)iDipidx ), 0.75f, 0xFFFFFFFF, DipSetting);
}
cellDbgFontDraw();
}
if (bDrvOkay)
{
cellDbgFontPrintf(0.7f, 0.86f + 0.025f, 0.75f, 0xFFE0EEFF ,"Cross - Change Input");
cellDbgFontDraw();
cellDbgFontPrintf(0.7f, 0.88f + 0.025f, 0.75f, 0xFFE0EEFF ,"Circle - Return to Game");
cellDbgFontDraw();
cellDbgFontPrintf(0.7f, 0.90f + 0.025f, 0.75f, 0xFFE0EEFF ,"Square - Reset to Defaults");
cellDbgFontDraw();
}
if (dipList)
{
for(i=0; i < m_DipListValues.size(); i++)
{
if (i==dipListSel)
cellDbgFontPuts(0.5f, 0.08f + 0.025f * ((float)i ), 0.75f, COLS, m_DipListValues[i].c_str());
else
cellDbgFontPuts(0.5f, 0.08f + 0.025f * ((float)i ), 0.75f, 0xFFFFFFFF, m_DipListValues[i].c_str());
cellDbgFontDraw();
}
}
cellDbgFontPrintf(0.05f, 0.92f + 0.025f, 0.50f, 0xFFFFE0E0, "Core %s - r%s - %s", szAppBurnVer, szSVNVer, szSVNDate);
cellDbgFontDraw();
}
void InputMenu()
{
int i;
int iTempInputSel;
int iInputidx;
// draw input list entries
iTempInputSel = iInputSelect;
cellDbgFontPuts(0.05f, 0.04f , 0.75f, 0xFFE0EEFF, "FBANext PS3 - Input Mapping Menu");
cellDbgFontDraw();
for(iInputidx=0; iInputidx < m_iMaxWindowListInput; iInputidx++)
{
int val = iTempInputSel++;
sprintf(InpSetting,"%s : %s", m_InputListData[val].c_str(), m_InputList[std::string((char *)m_InputListData[val].c_str())].c_str());
if (iInputidx==iInputCursorPos)
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)iInputidx ), 0.75f, COLS, InpSetting);
else
{
if (inputList)
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)iInputidx ), 0.75f, 0xA0A0A0A0, InpSetting);
else
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)iInputidx ), 0.75f, 0xFFFFFFFF, InpSetting);
}
cellDbgFontDraw();
}
if (bDrvOkay)
{
cellDbgFontPrintf(0.7f, 0.86f + 0.025f, 0.75f, 0xFFE0EEFF ,"Cross - Change Input");
cellDbgFontDraw();
cellDbgFontPrintf(0.7f, 0.88f + 0.025f, 0.75f, 0xFFE0EEFF ,"Circle - Return to Game");
cellDbgFontDraw();
cellDbgFontPrintf(0.7f, 0.90f + 0.025f, 0.75f, 0xFFE0EEFF ,"Square - Reset to Defaults");
cellDbgFontDraw();
cellDbgFontPrintf(0.7f, 0.92f + 0.025f, 0.75f, 0xFFE0EEFF ,"Triangle - Save as Preset");
cellDbgFontDraw();
}
if (inputList)
{
for(i=0; i < m_InputSettingsData.size(); i++)
{
if (i==inputListSel)
cellDbgFontPuts(0.5f, 0.08f + 0.025f * ((float)i ), 0.75f, COLS, m_InputSettingsData[i].c_str());
else
cellDbgFontPuts(0.5f, 0.08f + 0.025f * ((float)i ), 0.75f, 0xFFFFFFFF, m_InputSettingsData[i].c_str());
cellDbgFontDraw();
}
}
cellDbgFontPrintf(0.05f, 0.92f + 0.025f, 0.50f, 0xFFFFE0E0, "Core %s - r%s - %s", szAppBurnVer, szSVNVer, szSVNDate);
cellDbgFontDraw();
}
void InputFrameMove()
{
static uint64_t old_state;
uint64_t new_state = cell_pad_input_poll_device(0);
uint64_t diff_state = old_state ^ new_state;
if (CTRL_CIRCLE(new_state))
{
// switch to config
if (!inputList)
{
if (bDrvOkay) // theres a game loaded, return to game
{
old_state = new_state;
audio_play();
is_running = 1;
GameStatus = EMULATING;
return;
}
}
else
{
inputList = 0;
old_state = new_state;
}
}
else if (CTRL_CROSS(old_state & diff_state))
{
if (!inputList)
{
inputList = 1;
old_state = new_state;
return;
}
else
{
struct GameInp* pgi = NULL;
int id = inputListSel;
pgi = GameInp + m_InputListOffsets[iInputSelect + iInputCursorPos];
if (strstr(m_InputListData[iInputSelect + iInputCursorPos].c_str(), "Service"))
{
switch (id)
{
case 0:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_C;
break;
case 1:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_Z;
break;
case 2:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_X;
break;
case 3:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_V;
break;
case 4:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_1;
break;
case 5:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_5;
break;
case 6:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_S;
break;
case 7:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_D;
break;
case 8:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_F1;
break;
case 9:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_F2;
break;
case 10:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)PS3_L2_BUTTON;
break;
case 11:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)PS3_R2_BUTTON;
break;
}
}
else if (strstr(m_InputListData[iInputSelect+iInputCursorPos].c_str(), "P1"))
{
switch (id)
{
case 0:
KEY(FBK_C);
break;
case 1:
KEY(FBK_Z);
break;
case 2:
KEY(FBK_X);
break;
case 3:
KEY(FBK_V);
break;
case 4:
KEY(FBK_1);
break;
case 5:
KEY(FBK_5);
break;
case 6:
KEY(FBK_S);
break;
case 7:
KEY(FBK_D);
break;
case 8:
KEY(FBK_F1);
break;
case 9:
KEY(FBK_F2);
break;
case 10:
KEY(PS3_L2_BUTTON);
break;
case 11:
KEY(PS3_R2_BUTTON);
break;
case 12:
KEY(PS3_L3_BUTTON);
break;
case 13:
KEY(PS3_R3_BUTTON);
break;
}
}
else if (strstr(m_InputListData[iInputSelect+iInputCursorPos].c_str(), "P2"))
{
switch (id)
{
case 0:
KEY(0x4082);
break;
case 1:
KEY(0x4080);
break;
case 2:
KEY(0x4081);
break;
case 3:
KEY(0x4083);
break;
case 4:
KEY(0x03);
break;
case 5:
KEY(0x07);
break;
case 6:
KEY(0x4084);
break;
case 7:
KEY(0x4085);
break;
case 8:
KEY(PS3_L3_BUTTON | 0x4000);
break;
case 9:
KEY(PS3_R3_BUTTON | 0x4000);
break;
case 10:
KEY(PS3_L2_BUTTON | 0x4000);
break;
case 11:
KEY(PS3_R2_BUTTON | 0x4000);
break;
}
}
else if (strstr(m_InputListData[iInputSelect+iInputCursorPos].c_str(), "P3"))
{
switch (id)
{
case 0:
KEY(0x4182);
break;
case 1:
KEY(0x4180);
break;
case 2:
KEY(0x4181);
break;
case 3:
KEY(0x4183);
break;
case 4:
KEY(0x04);
break;
case 5:
KEY(0x08);
break;
case 6:
KEY(0x4184);
break;
case 7:
KEY(0x4185);
break;
case 8:
KEY(PS3_L3_BUTTON | 0x4100);
break;
case 9:
KEY(PS3_R3_BUTTON | 0x4100);
break;
case 10:
KEY(PS3_L2_BUTTON | 0x4100);
break;
case 11:
KEY(PS3_R2_BUTTON | 0x4100);
break;
}
}
else if (strstr(m_InputListData[iInputSelect+iInputCursorPos].c_str(), "P4"))
{
switch (id)
{
case 0:
KEY(0x4282);
break;
case 1:
KEY(0x4280);
break;
case 2:
KEY(0x4281);
break;
case 3:
KEY(0x4283);
break;
case 4:
KEY(0x05);
break;
case 5:
KEY(0x09);
break;
case 6:
KEY(0x4284);
break;
case 7:
KEY(0x4285);
break;
case 8:
KEY(PS3_L3_BUTTON | 0x4200);
break;
case 9:
KEY(PS3_R3_BUTTON | 0x4200);
break;
case 10:
KEY(PS3_L2_BUTTON | 0x4200);
break;
case 11:
KEY(PS3_R2_BUTTON | 0x4200);
break;
}
}
else
{
switch (id)
{
case 0:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_C;
break;
case 1:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_Z;
break;
case 2:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_X;
break;
case 3:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_V;
break;
case 4:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_1;
break;
case 5:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_5;
break;
case 6:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_S;
break;
case 7:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)FBK_D;
break;
case 8:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)PS3_L3_BUTTON;
break;
case 9:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)PS3_R3_BUTTON;
break;
case 10:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)PS3_L2_BUTTON;
break;
case 11:
pgi->nInput = GIT_SWITCH;
pgi->Input.Switch = (unsigned short)PS3_R2_BUTTON;
break;
}
}
LoadInputs();
inputList = 0;
old_state = new_state;
}
}
else if(CTRL_DOWN(new_state & diff_state) | CTRL_R2(new_state) | CTRL_LSTICK_DOWN(new_state))
{
sys_timer_usleep(FILEBROWSER_DELAY);
if (!inputList)
{
bool bClampCursor = FALSE; // default don`t clamp cursor
iInputCursorPos ++;
if(iInputCursorPos > m_iWindowMiddleInput)
{
bClampCursor = TRUE; // clamp cursor position
// advance gameselect
if(iInputSelect == 0)
iInputSelect += (iInputCursorPos - m_iWindowMiddleInput);
else
iInputSelect ++;
// clamp game window range (high)
if((iInputSelect + m_iMaxWindowListInput) > iNumInput)
{
iInputSelect = iNumInput - m_iMaxWindowListInput; // clamp to end
bClampCursor = FALSE; // advance cursor pos after all!
// clamp cursor to end
if((iInputSelect + iInputCursorPos) >= iNumInput)
iInputCursorPos = m_iMaxWindowListInput-1;
}
}
// check for cursor clamp
if(bClampCursor)
iInputCursorPos = m_iWindowMiddleInput;
}
else
{
inputListSel++;
if (inputListSel > m_InputSettingsData.size()-1)
inputListSel = m_InputSettingsData.size()-1;
}
old_state = new_state;
}
else if(CTRL_UP(new_state & diff_state) | CTRL_L2(new_state) | CTRL_LSTICK_UP(new_state))
{
sys_timer_usleep(FILEBROWSER_DELAY);
if (!inputList)
{
// default don`t clamp cursor
bool bClampCursor = FALSE;
iInputCursorPos --;
if(iInputCursorPos < m_iWindowMiddleInput)
{
// clamp cursor position
bClampCursor = TRUE;
// backup window pos
iInputSelect --;
// clamp game window range (low)
if(iInputSelect < 0)
{
// clamp to start
iInputSelect = 0;
// backup cursor pos after all!
bClampCursor = FALSE;
// clamp cursor to end
if(iInputCursorPos < 0)
iInputCursorPos = 0;
}
}
// check for cursor clamp
if(bClampCursor)
iInputCursorPos = m_iWindowMiddleInput;
}
else
{
inputListSel--;
if (inputListSel < 0)
inputListSel = 0;
}
old_state = new_state;
}
else if (CTRL_TRIANGLE(old_state & diff_state))
{
if (SaveDefaultInput()==0)
{
dialog_is_running = true;
cellMsgDialogOpen2(CELL_MSGDIALOG_DIALOG_TYPE_NORMAL| \
CELL_MSGDIALOG_TYPE_BG_VISIBLE| \
CELL_MSGDIALOG_TYPE_BUTTON_TYPE_NONE|CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_OFF|\
CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_OK,\
"Input Preset saved.",cb_dialog_ok,NULL,NULL);
while(dialog_is_running)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
psglSwap();
cellSysutilCheckCallback();
}
}
else
{
dialog_is_running = true;
cellMsgDialogOpen2(CELL_MSGDIALOG_TYPE_SE_TYPE_ERROR| \
CELL_MSGDIALOG_TYPE_BG_VISIBLE| \
CELL_MSGDIALOG_TYPE_BUTTON_TYPE_NONE|CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_OFF|\
CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_OK,\
"Error saving Input Preset.",cb_dialog_ok,NULL,NULL);
while(dialog_is_running)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
psglSwap();
cellSysutilCheckCallback();
}
}
old_state = new_state;
}
else if (CTRL_SQUARE(old_state & diff_state))
{
struct GameInp* pgi = NULL;
unsigned int i;
for (i = 0, pgi = GameInp; i < nGameInpCount; i++, pgi++)
{
struct BurnInputInfo bii;
// Get the extra info about the input
bii.szInfo = NULL;
BurnDrvGetInputInfo(&bii, i);
if (bii.pVal == NULL)
continue;
if (bii.szInfo == NULL)
bii.szInfo = "";
GamcPlayer(pgi, (char*)bii.szInfo, 0, -1); // Keyboard
GamcMisc(pgi, (char*)bii.szInfo, 0);
}
old_state = new_state;
LoadInputs();
}
old_state = new_state;
}
void InGameMenu()
{
cellDbgFontPuts(0.05f, 0.04f , 0.75f, 0xFFE0EEFF, "FBANext PS3 - In Game Menu");
cellDbgFontDraw();
int number = 0;
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_MAP_BUTTONS ? COLS : 0xFFFFFFFF, "Map Gamepad Buttons" );
cellDbgFontDraw();
number++;
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_DIP_SWITCHES ? COLS : 0xFFFFFFFF, "Map Dip Switches");
cellDbgFontDraw();
number++;
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_RESIZE_SCREEN ? COLS : 0xFFFFFFFF, "Resize Screen");
cellDbgFontDraw();
number++;
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_FRAME_ADVANCE ? COLS : 0xFFFFFFFF, "Frame Advance");
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_FBO_ENABLED ? COLS : 0xFFFFFFFF, "Custom Scaling/Dual Shaders: %s", bVidFBOEnabled ? "Yes" : "No");
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_CURRENT_SHADER ? COLS : 0xFFFFFFFF, "Current Shader #1: %s", m_ListShaderData[shaderindex].c_str());
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_CURRENT_SHADER2 ? COLS : 0xFFFFFFFF, "Current Shader #2: %s", m_ListShader2Data[shaderindex2].c_str());
cellDbgFontDraw();
number++;
char msg[256];
switch(nVidScrnAspectMode)
{
case ASPECT_RATIO_CUSTOM:
sprintf(msg,"Custom (Resized)");
break;
case ASPECT_RATIO_AUTO:
sprintf(msg,"Auto %d:%d", nVidScrnAspectX, nVidScrnAspectY);
break;
case ASPECT_RATIO_AUTO_FBA:
sprintf(msg,"Auto (FBA) %d:%d", nVidScrnAspectX, nVidScrnAspectY);
break;
default:
sprintf(msg,"%d:%d", nVidScrnAspectX, nVidScrnAspectY);
break;
}
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_KEEP_ASPECT ? COLS : 0xFFFFFFFF, "Aspect Ratio : %s", msg);
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_BILINEAR_FILTER ? COLS : 0xFFFFFFFF, "Hardware Filter Shader #1: %s", vidFilterLinear ? "Linear" : "Point");
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_BILINEAR_FILTER2 ? COLS : 0xFFFFFFFF, "Hardware Filter Shader #2: %s", vidFilterLinear2 ? "Linear" : "Point");
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_SCALING_FACTOR ? COLS : 0xFFFFFFFF, "Scaling Factor: %dx", bVidScalingFactor);
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_OVERSCAN ? COLS : 0xFFFFFFFF, "Overscan: %f", m_overscan_amount);
cellDbgFontDraw();
number++;
char rotatemsg[3][256] = {{"Rotate for Vertical Games"},{"Do not rotate for Vertical Games"},{"Reverse flipping for vertical games"}};
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_ROTATE ? COLS : 0xFFFFFFFF, "Rotation Adjust: %s", rotatemsg[nVidRotationAdjust]);
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_SAVE_STATE ? COLS : 0xFFFFFFFF, "Save State #%d", save_state_slot);
cellDbgFontDraw();
number++;
cellDbgFontPrintf(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_LOAD_STATE ? COLS : 0xFFFFFFFF, "Load State #%d", save_state_slot);
cellDbgFontDraw();
number++;
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_RESET_GAME ? COLS : 0xFFFFFFFF, "Reset Game");
cellDbgFontDraw();
number++;
#ifdef MULTIMAN_SUPPORT
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_RETURN_TO_MULTIMAN ? COLS : 0xFFFFFFFF, "Return to multiMAN");
cellDbgFontDraw();
number++;
#endif
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_EXIT_GAME ? COLS : 0xFFFFFFFF, "Exit Game");
cellDbgFontDraw();
number++;
cellDbgFontPuts(0.05f, 0.08f + 0.025f * ((float)number), 0.75f, inGameIndex == INGAME_BACK_TO_GAME ? COLS : 0xFFFFFFFF, "Return to current Game");
cellDbgFontDraw();
cellDbgFontPrintf(0.05f, 0.92f + 0.025f, 0.50f, 0xFFFFE0E0, "Core %s - r%s - %s", szAppBurnVer, szSVNVer, szSVNDate);
cellDbgFontDraw();
}
void StretchMenu()
{
cellDbgFontPuts(0.05f, 0.04f , 0.75f, 0xFFE0EEFF, "FBANext PS3 - Resize Screen Menu");
cellDbgFontDraw();
cellDbgFontPrintf(0.7f, 0.86f + 0.025f, 0.75f, 0xFFE0EEFF ,"Triangle - Reset to Default");
cellDbgFontDraw();
cellDbgFontPrintf(0.7f, 0.88f + 0.025f, 0.75f, 0xFFE0EEFF ,"Circle - Return to Game");
cellDbgFontDraw();
cellDbgFontPrintf(0.05f, 0.92f + 0.025f, 0.50f, 0xFFFFE0E0, "Core %s - r%s - %s", szAppBurnVer, szSVNVer, szSVNDate);
cellDbgFontDraw();
}
void InGameFrameMove()
{
int nRet = 0;
static uint64_t old_state = 0;
uint64_t new_state = cell_pad_input_poll_device(0);
uint64_t diff_state = old_state ^ new_state;
if (CTRL_CIRCLE(old_state & diff_state))
{
// switch to config
if (bDrvOkay) // theres a game loaded, return to game
{
old_state = new_state;
audio_play();
is_running = 1;
GameStatus = EMULATING;
return;
}
}
else if(CTRL_DOWN(new_state & diff_state) | CTRL_LSTICK_DOWN(new_state))
{
if(inGameIndex < LAST_INGAME_SETTING)
{
inGameIndex++;
sys_timer_usleep(FILEBROWSER_DELAY);
}
}
else if(CTRL_UP(new_state & diff_state) | CTRL_LSTICK_UP(new_state))
{
if(inGameIndex > 0)
{
inGameIndex--;
sys_timer_usleep(FILEBROWSER_DELAY);
}
}
switch(inGameIndex)
{
case INGAME_MAP_BUTTONS:
if(CTRL_CROSS(old_state & diff_state))
{
if (bDrvOkay)
{
LoadInputs();
GameStatus = INPUT_MENU;
}
}
break;
case INGAME_DIP_SWITCHES:
if(CTRL_CROSS(old_state & diff_state))
{
if (bDrvOkay)
{
LoadDIPS();
GameStatus = DIP_MENU;
}
}
break;
case INGAME_RESIZE_SCREEN:
if(CTRL_CROSS(old_state & diff_state))
{
if (bDrvOkay)
{
GameStatus = SCREEN_RESIZE;
}
}
break;
case INGAME_FRAME_ADVANCE:
if(CTRL_CROSS(old_state & diff_state) || CTRL_R2(new_state))
{
old_state = new_state;
audio_play();
is_running = 0;
GameStatus = EMULATING;
}
break;
case INGAME_FBO_ENABLED:
if(CTRL_LEFT(new_state & diff_state) | CTRL_RIGHT(new_state & diff_state) | CTRL_CROSS(old_state & diff_state))
bVidFBOEnabled = !bVidFBOEnabled;
if(CTRL_CROSS(old_state & diff_state))
{
//FBO mode needs to be applied here
//Screen reinited
}
break;
case INGAME_CURRENT_SHADER:
if(CTRL_LEFT(new_state & diff_state) | CTRL_LSTICK_LEFT(new_state))
{
if(shaderindex > 0)
shaderindex--;
}
if(CTRL_RIGHT(new_state & diff_state) | CTRL_LSTICK_RIGHT(new_state))
{
if(shaderindex < m_ListShaderData.size()-1)
shaderindex ++;
}
if(CTRL_CROSS(old_state & diff_state))
{
selectedShader[0].index = shaderindex;
strcpy(selectedShader[0].filename, m_ListShaderData[shaderindex].c_str());
sprintf(selectedShader[0].fullpath, SHADER_DIRECTORY, m_ListShaderData[shaderindex].c_str());
psglInitShader(selectedShader[0].fullpath, 0);
BurnReinitScrn();
VidFrame();
}
break;
case INGAME_CURRENT_SHADER2:
if(CTRL_LEFT(new_state & diff_state) | CTRL_LSTICK_LEFT(new_state))
{
if(shaderindex2 > 0)
shaderindex2--;
}
if(CTRL_RIGHT(new_state & diff_state) | CTRL_LSTICK_RIGHT(new_state))
{
if(shaderindex2 < m_ListShader2Data.size()-1)
shaderindex2++;
}
if(CTRL_CROSS(old_state & diff_state))
{
selectedShader[1].index = shaderindex2;
strcpy(selectedShader[1].filename, m_ListShader2Data[shaderindex2].c_str());
sprintf(selectedShader[1].fullpath, SHADER_DIRECTORY, m_ListShader2Data[shaderindex2].c_str());
psglInitShader(selectedShader[1].fullpath, 1);
BurnReinitScrn();
VidFrame();
}
break;
case INGAME_KEEP_ASPECT:
if(CTRL_LEFT(new_state & diff_state))
{
if(nVidScrnAspectMode > 0)
{
nVidScrnAspectMode--;
setWindowAspect(0);
BurnReinitScrn();
VidFrame();
}
}
else if(CTRL_RIGHT(new_state & diff_state) | CTRL_CROSS(old_state & diff_state))
{
if(nVidScrnAspectMode < LAST_ASPECT_RATIO)
{
nVidScrnAspectMode++;
setWindowAspect(0);
BurnReinitScrn();
VidFrame();
}
}
break;
case INGAME_BILINEAR_FILTER:
if(CTRL_LEFT(new_state & diff_state) | CTRL_RIGHT(new_state & diff_state) | CTRL_CROSS(old_state & diff_state))
{
vidFilterLinear = !vidFilterLinear;
setlinear(vidFilterLinear);
VidFrame();
}
break;
case INGAME_BILINEAR_FILTER2:
if(CTRL_LEFT(new_state & diff_state) | CTRL_RIGHT(new_state & diff_state) | CTRL_CROSS(old_state & diff_state))
{
vidFilterLinear2 = !vidFilterLinear2;
setlinear(vidFilterLinear2);
VidFrame();
}
break;
case INGAME_SCALING_FACTOR:
if(CTRL_LEFT(new_state & diff_state) | CTRL_LSTICK_LEFT(new_state))
{
if(bVidScalingFactor > 1)
bVidScalingFactor--;
}
if(CTRL_RIGHT(new_state & diff_state) | CTRL_LSTICK_RIGHT(new_state))
{
if(bVidScalingFactor < SCALING_FACTOR_LIMIT)
bVidScalingFactor++;
}
if(CTRL_CROSS(old_state & diff_state))
{
//apply scale here, and reapply FBO if activated
//reapply screen here
BurnReinitScrn();
VidFrame();
}
break;
case INGAME_OVERSCAN:
if(CTRL_LEFT(new_state & diff_state) | CTRL_LSTICK_LEFT(new_state))
{
if(m_overscan_amount == 0.0f)
m_overscan = false;
else
m_overscan = true;
m_overscan_amount -= 0.01f;
CalculateViewports();
glSetViewports();
}
if(CTRL_RIGHT(new_state & diff_state) | CTRL_LSTICK_RIGHT(new_state))
{
if(m_overscan_amount == 0.0f)
m_overscan = false;
else
m_overscan = true;
m_overscan_amount += 0.01f;
CalculateViewports();
glSetViewports();
}
if(CTRL_START(old_state & diff_state))
{
m_overscan = false;
m_overscan_amount = 0.0f;
CalculateViewports();
glSetViewports();
}
break;
case INGAME_ROTATE:
if(CTRL_LEFT(new_state & diff_state) | CTRL_RIGHT(new_state & diff_state) | CTRL_CROSS(old_state & diff_state))
{
nVidRotationAdjust++;
if (nVidRotationAdjust > 2)
nVidRotationAdjust = 0;
BurnReinitScrn(); //apply_rotation_settings();
VidFrame();
}
break;
case INGAME_SAVE_STATE:
if(CTRL_LEFT(new_state & diff_state) | CTRL_LSTICK_LEFT(new_state))
{
if(save_state_slot > 0)
save_state_slot--;
}
if(CTRL_RIGHT(new_state & diff_state) | CTRL_LSTICK_RIGHT(new_state))
save_state_slot++;
if(CTRL_CROSS(old_state & diff_state))
{
if (StatedSave(save_state_slot)==0)
{
dialog_is_running = true;
cellMsgDialogOpen2(CELL_MSGDIALOG_DIALOG_TYPE_NORMAL| \
CELL_MSGDIALOG_TYPE_BG_VISIBLE| \
CELL_MSGDIALOG_TYPE_BUTTON_TYPE_NONE|CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_OFF|\
CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_OK,\
"State saved successfully.",cb_dialog_ok,NULL,NULL);
while(dialog_is_running)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
psglSwap();
cellSysutilCheckCallback();
}
}
else
{
dialog_is_running = true;
cellMsgDialogOpen2(CELL_MSGDIALOG_TYPE_SE_TYPE_ERROR| \
CELL_MSGDIALOG_TYPE_BG_VISIBLE| \
CELL_MSGDIALOG_TYPE_BUTTON_TYPE_NONE|CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_OFF|\
CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_OK,\
"Error saving state.",cb_dialog_ok,NULL,NULL);
while(dialog_is_running)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
psglSwap();
cellSysutilCheckCallback();
}
}
}
break;
case INGAME_LOAD_STATE:
if(CTRL_LEFT(new_state & diff_state) | CTRL_LSTICK_LEFT(new_state))
{
if(save_state_slot > 0)
save_state_slot--;
}
if(CTRL_RIGHT(new_state & diff_state) | CTRL_LSTICK_RIGHT(new_state))
save_state_slot++;
if(CTRL_CROSS(old_state & diff_state))
{
nRet = StatedLoad(save_state_slot);
if (bDrvOkay) // theres a game loaded, return to game
{
old_state = new_state;
audio_play();
GameStatus = EMULATING;
}
}
break;
case INGAME_RESET_GAME:
if(CTRL_CROSS(old_state & diff_state))
{
DoReset = true;
if (bDrvOkay) // theres a game loaded, return to game
{
old_state = new_state;
audio_play();
is_running = 1;
GameStatus = EMULATING;
}
}
break;
case INGAME_EXIT_GAME:
if(CTRL_CROSS(old_state & diff_state))
{
if (bDrvOkay)
{
if (nPrevGame < nBurnDrvCount)
{
old_state = new_state;
nBurnDrvSelect = nPrevGame;
is_running = 0;
nPrevGame = ~0U;
audio_stop();
BurnerDrvExit(); // Make sure any game driver is exited
mediaExit(); // Exit media
GameStatus = MENU;
}
}
}
break;
#ifdef MULTIMAN_SUPPORT
case INGAME_RETURN_TO_MULTIMAN:
if(CTRL_CROSS(old_state & diff_state))
{
configAppSaveXml();
sys_spu_initialize(6, 0);
char multiMAN[512];
sprintf(multiMAN, "%s", MULTIMAN_SELF);
sys_game_process_exitspawn2((char*) multiMAN, NULL, NULL, NULL, 0, 2048, SYS_PROCESS_PRIMARY_STACK_SIZE_64K);
sys_process_exit(0);
}
break;
#endif
case INGAME_BACK_TO_GAME:
if(CTRL_CROSS(old_state & diff_state))
{
if (bDrvOkay) // theres a game loaded, return to game
{
old_state = new_state;
audio_play();
is_running = 1;
GameStatus = EMULATING;
}
}
break;
}
//InGameMenu();
old_state = new_state;
}
void FrameMove()
{
static uint64_t old_state = 0;
uint64_t new_state = cell_pad_input_poll_device(0);
uint64_t diff_state = old_state ^ new_state;
if(CTRL_R2(new_state))
{
// default don`t clamp cursor
bool bClampCursor = FALSE;
iCursorPos ++;
if(iCursorPos > m_iWindowMiddle)
{
bClampCursor = TRUE; // clamp cursor position
// advance gameselect
if(iGameSelect == 0)
iGameSelect += (iCursorPos - m_iWindowMiddle);
else
iGameSelect ++;
// clamp game window range (high)
if((iGameSelect + m_iMaxWindowList) > iNumGames)
{
iGameSelect = iNumGames - m_iMaxWindowList; // clamp to end
bClampCursor = FALSE; // advance cursor pos after all!
// clamp cursor to end
if((iGameSelect + iCursorPos) >= iNumGames)
iCursorPos = m_iMaxWindowList-1;
}
}
// check for cursor clamp
if( bClampCursor )
iCursorPos = m_iWindowMiddle;
}
if( CTRL_DOWN(new_state & diff_state) || CTRL_LSTICK_DOWN(new_state))
{
sys_timer_usleep(FILEBROWSER_DELAY);
// default don`t clamp cursor
bool bClampCursor = FALSE;
iCursorPos ++;
if(iCursorPos > m_iWindowMiddle)
{
// clamp cursor position
bClampCursor = TRUE;
// advance gameselect
if(iGameSelect == 0)
iGameSelect += (iCursorPos - m_iWindowMiddle);
else
iGameSelect ++;
// clamp game window range (high)
if((iGameSelect + m_iMaxWindowList) > iNumGames)
{
// clamp to end
iGameSelect = iNumGames - m_iMaxWindowList;
// advance cursor pos after all!
bClampCursor = FALSE;
// clamp cursor to end
if((iGameSelect + iCursorPos) >= iNumGames)
iCursorPos = m_iMaxWindowList-1;
}
}
// check for cursor clamp
if( bClampCursor )
iCursorPos = m_iWindowMiddle;
}
else if (CTRL_L1(old_state & diff_state))
{
CurrentFilter--;
if (CurrentFilter < 0)
CurrentFilter = 14;
BuildRomList();
}
else if (CTRL_R1(old_state & diff_state))
{
CurrentFilter++;
if (CurrentFilter > 14)
CurrentFilter = 0;
BuildRomList();
}
else if (CTRL_CIRCLE(new_state))
{
if (GameStatus == PAUSE)
{
// switch back to emulation
old_state = new_state;
audio_play();
is_running = 1;
GameStatus = EMULATING;
return;
}
}
else if (CTRL_SELECT(old_state & diff_state))
{
if (!bDrvOkay)
{
// switch to config
GameStatus = CONFIG_MENU;
}
}
else if (CTRL_START(old_state & diff_state))
{
if (bDrvOkay)
{
if (nPrevGame < nBurnDrvCount)
{
nBurnDrvSelect = nPrevGame;
nPrevGame = ~0U;
audio_stop();
BurnerDrvExit(); // Make sure any game driver is exited
mediaExit(); // Exit media
}
}
}
else if (CTRL_TRIANGLE(old_state & diff_state))
{
HideChildren = !HideChildren;
BuildRomList();
}
else if (CTRL_SQUARE(old_state & diff_state))
{
ThreeOrFourPlayerOnly = !ThreeOrFourPlayerOnly;
BuildRomList();
}
else if( CTRL_UP(new_state & diff_state) | CTRL_LSTICK_UP(new_state))
{
// default don`t clamp cursor
sys_timer_usleep(FILEBROWSER_DELAY);
bool bClampCursor = FALSE;
iCursorPos --;
if(iCursorPos < m_iWindowMiddle)
{
bClampCursor = TRUE; // clamp cursor position
iGameSelect --; // backup window pos
if(iGameSelect < 0) // clamp game window range (low)
{
iGameSelect = 0; // clamp to start
bClampCursor = FALSE; // backup cursor pos after all!
// clamp cursor to end
if( iCursorPos < 0 )
iCursorPos = 0;
}
}
// check for cursor clamp
if( bClampCursor )
iCursorPos = m_iWindowMiddle;
}
else if(CTRL_L2(new_state))
{
// default don`t clamp cursor
bool bClampCursor = FALSE;
iCursorPos --;
if(iCursorPos < m_iWindowMiddle)
{
bClampCursor = TRUE; // clamp cursor position
iGameSelect --; // backup window pos
// clamp game window range (low)
if(iGameSelect < 0)
{
iGameSelect = 0; // clamp to start
bClampCursor = FALSE; // backup cursor pos after all!
// clamp cursor to end
if( iCursorPos < 0 )
iCursorPos = 0;
}
}
// check for cursor clamp
if(bClampCursor)
iCursorPos = m_iWindowMiddle;
}
else if(CTRL_CROSS(new_state))
{
// initalise emulation here and set emulating to true
int entryselected = iGameSelect + iCursorPos;
if (iNumGames > 0)
{
nBurnDrvSelect = (unsigned int)m_vecAvailRomBurnDrvIndex[entryselected];
if (nPrevGame == nBurnDrvSelect)
{
// same game, do nothing
old_state = new_state;
audio_play();
GameStatus = EMULATING_INIT;
return;
}
if (bDrvOkay)
{
if ( nPrevGame < nBurnDrvCount)
{
nBurnDrvSelect = nPrevGame;
nPrevGame = ~0U;
audio_stop();
BurnerDrvExit(); // Make sure any game driver is exited
mediaExit(); // Exit media
}
}
nBurnFPS = 6000; // Hardcoded FPS
nFMInterpolation = 0; // FM Interpolation hardcoded to 0
if (directLoadGame(m_vecAvailRomIndex[entryselected].c_str()) == 0)
{
nPrevGame = m_vecAvailRomBurnDrvIndex[entryselected];
//nCurrentBurnDrvSelect = nBurnDrvSelect;
nLastRom = entryselected;
nLastFilter = CurrentFilter;
GameStatus = EMULATING_INIT;
return;
}
else
{
nBurnDrvSelect = nPrevGame;
nPrevGame = ~0U;
audio_stop();
BurnerDrvExit(); // Make sure any game driver is exited
mediaExit(); // Exit media
}
nPrevGame = nBurnDrvSelect;
}
}
old_state = new_state;
}
| [
"[email protected]"
] | [
[
[
1,
2845
]
]
] |
3e38a5a41c3d1a3db2c2f611d875fb04bcda48a2 | 77aa13a51685597585abf89b5ad30f9ef4011bde | /dep/src/boost/boost/throw_exception.hpp | 4779335e99abfb06aec0b627154c27b46beb5b31 | [] | no_license | Zic/Xeon-MMORPG-Emulator | 2f195d04bfd0988a9165a52b7a3756c04b3f146c | 4473a22e6dd4ec3c9b867d60915841731869a050 | refs/heads/master | 2021-01-01T16:19:35.213330 | 2009-05-13T18:12:36 | 2009-05-14T03:10:17 | 200,849 | 8 | 10 | null | null | null | null | UTF-8 | C++ | false | false | 2,159 | hpp | #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
#define BOOST_THROW_EXCEPTION_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//
// boost/throw_exception.hpp
//
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2008 Emil Dotchevski and Reverge Studios, Inc.
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// http://www.boost.org/libs/utility/throw_exception.html
//
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <exception>
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x593) )
# define BOOST_EXCEPTION_DISABLE
#endif
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1310 )
# define BOOST_EXCEPTION_DISABLE
#endif
#if !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE )
# include <boost/exception/exception.hpp>
# include <boost/current_function.hpp>
# define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(::boost::enable_error_info(x) <<\
::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
::boost::throw_file(__FILE__) <<\
::boost::throw_line((int)__LINE__))
#else
# define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
#endif
namespace boost
{
#ifdef BOOST_NO_EXCEPTIONS
void throw_exception( std::exception const & e ); // user defined
#else
inline void throw_exception_assert_compatibility( std::exception const & ) { }
template<class E> inline void throw_exception( E const & e )
{
//All boost exceptions are required to derive std::exception,
//to ensure compatibility with BOOST_NO_EXCEPTIONS.
throw_exception_assert_compatibility(e);
#ifndef BOOST_EXCEPTION_DISABLE
throw enable_current_exception(enable_error_info(e));
#else
throw e;
#endif
}
#endif
} // namespace boost
#endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
| [
"pepsi1x1@a6a5f009-272a-4b40-a74d-5f9816a51f88"
] | [
[
[
1,
74
]
]
] |
405e24560288912a5e555822792b2b04819fa122 | f3f0f91a63558b803ec1f150165aa49e093808f9 | /alignment/Sequence.h | 70b20064e8802291cbb21aaeeca0009c5b5f2426 | [] | no_license | kimmensjolander/bpg-sci-phy | 5989c2030e6d83b304da2cf92e0e7f3eb327e3b4 | fefecd3022383dc7bad55b050854e402600164ec | refs/heads/master | 2020-03-29T12:26:33.422675 | 2010-10-18T21:46:41 | 2010-10-18T21:46:41 | 32,128,561 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 649 | h | #ifndef SEQUENCE_H
#define SEQUENCE_H
#include <vector>
#include <string>
#include "../general/userparams.h"
using namespace std;
namespace sciphy
{
class Sequence
{
public:
Sequence();
Sequence(string& seq, string& name, string& title);
~Sequence();
void encodeSequence();
void printSequence();
vector<int>* getSequence();
string getName();
string getTitle();
private:
void copyStringIntoVector(vector<char>* _vectorTo, string* _stringFrom);
vector<char> _sequence;
vector<int> _encodedSequence;
string _name;
string _title;
};
}
#endif
| [
"[email protected]@ed72bfb6-bbaa-95bc-2366-9432bd51d671"
] | [
[
[
1,
38
]
]
] |
d8cd7d7ccc17db8aff10353f068a62f8e51ff0d9 | 91b964984762870246a2a71cb32187eb9e85d74e | /SRC/OFFI SRC!/_Interface/WndMotion.h | d4b653aeff471c122b1e13d2c6685ce042bb6eee | [] | no_license | willrebuild/flyffsf | e5911fb412221e00a20a6867fd00c55afca593c7 | d38cc11790480d617b38bb5fc50729d676aef80d | refs/heads/master | 2021-01-19T20:27:35.200154 | 2011-02-10T12:34:43 | 2011-02-10T12:34:43 | 32,710,780 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,385 | h | #ifndef __WNDMOTION__H
#define __WNDMOTION__H
class CWndMotion1 : public CWndBase
{
MotionProp* m_pSelectMotion;
int m_nSelect;
CPtrArray m_motionArray;
public:
CWndMotion1();
virtual ~CWndMotion1();
virtual void OnDraw(C2DRender* p2DRender);
virtual void OnInitialUpdate();
virtual BOOL Initialize(CWndBase* pWndParent = NULL,DWORD dwWndId = 0);
// message
virtual BOOL Process();
virtual BOOL OnCommand( UINT nID, DWORD dwMessage, CWndBase* pWndBase = NULL );
virtual BOOL OnChildNotify(UINT message,UINT nID,LRESULT* pLResult);
virtual void OnSize(UINT nType, int cx, int cy);
virtual void OnLButtonUp(UINT nFlags, CPoint point);
virtual void OnLButtonDown(UINT nFlags, CPoint point);
virtual void OnMouseWndSurface( CPoint point );
virtual void OnMouseMove(UINT nFlags, CPoint point);
};
class CWndEmoticon : public CWndBase
{
CTexture* m_pSelectTexture;
int m_nSelect;
CPtrArray m_emoticonArray;
public:
CWndEmoticon();
virtual ~CWndEmoticon();
virtual void OnDraw(C2DRender* p2DRender);
virtual void OnInitialUpdate();
virtual BOOL Initialize(CWndBase* pWndParent = NULL,DWORD dwWndId = 0);
// message
virtual BOOL OnCommand( UINT nID, DWORD dwMessage, CWndBase* pWndBase = NULL );
virtual BOOL OnChildNotify(UINT message,UINT nID,LRESULT* pLResult);
virtual void OnSize(UINT nType, int cx, int cy);
virtual void OnLButtonUp(UINT nFlags, CPoint point);
virtual void OnLButtonDown(UINT nFlags, CPoint point);
virtual void OnMouseWndSurface( CPoint point );
virtual void OnMouseMove(UINT nFlags, CPoint point);
};
class CWndMotion : public CWndNeuz
{
public:
CWndMotion1 m_wndMotion1;
CWndEmoticon m_wndEmoticon;
CWndMotion();
~CWndMotion();
virtual void OnMouseWndSurface( CPoint point );
virtual BOOL Initialize( CWndBase* pWndParent = NULL, DWORD nType = MB_OK );
virtual BOOL OnChildNotify( UINT message, UINT nID, LRESULT* pLResult );
virtual void OnDraw( C2DRender* p2DRender );
virtual void OnInitialUpdate();
virtual BOOL OnCommand( UINT nID, DWORD dwMessage, CWndBase* pWndBase );
virtual void OnSize( UINT nType, int cx, int cy );
virtual void OnLButtonUp( UINT nFlags, CPoint point );
virtual void OnLButtonDown( UINT nFlags, CPoint point );
virtual void OnMouseMove(UINT nFlags, CPoint point);
};
#endif
| [
"[email protected]@e2c90bd7-ee55-cca0-76d2-bbf4e3699278"
] | [
[
[
1,
78
]
]
] |
958105bbdfd1c8daf3eeb6128e49b16447a8526e | d6eba554d0c3db3b2252ad34ffce74669fa49c58 | /Source/Wrappers/CSGD_FModManager.cpp | 1f5588d794bc10cafd49c903142962da62472d21 | [] | no_license | nbucciarelli/Polarity-Shift | e7246af9b8c3eb4aa0e6aaa41b17f0914f9d0b10 | 8b9c982f2938d7d1e5bd1eb8de0bdf10505ed017 | refs/heads/master | 2016-09-11T00:24:32.906933 | 2008-09-26T18:01:01 | 2008-09-26T18:01:01 | 3,408,115 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,388 | cpp | //______________________________________________________________________________
//
// File:...... CSGD_FModManager.cpp
//
// Author:.... Robert Martinez (Bobby)
//
// Date:...... 12/29/2007 12:16:36 AM
//
// Purpose:.... function definitions for fMod wrapper class
//______________________________________________________________________________
#include "CSGD_FModManager.h"
#include <assert.h>
#include "..\game.h"
CSGD_FModManager CSGD_FModManager::m_pInstance; // initialization of single class instance
CSGD_FModManager::CSGD_FModManager(void) : m_pSystem(NULL) , m_hWnd(0), m_dwCurrentTime(0), m_dwPreviousTime(0), m_dTimeAccumulator(0)
{
}
CSGD_FModManager::~CSGD_FModManager(void)
{
}
CSGD_FModManager *CSGD_FModManager::GetInstance( void )
{
return &m_pInstance; // return instance of the class
}
bool CSGD_FModManager::InitFModManager( HWND hWnd, int nMaxChannels, FMOD_INITFLAGS unFlags, void *vExtraDriverData )
{
// Paranoid error check
if (!hWnd || nMaxChannels < 0 || unFlags < 0) return false;
// get handle to window
m_hWnd = hWnd;
// used to catch fMod-specific error codes
FMOD_RESULT result;
// Create the main system object.
if ((result = FMOD::System_Create(&m_pSystem)) != FMOD_OK)
{
FMODERR( result );
}
// Initialize FMOD.
if ((result = m_pSystem->init( nMaxChannels, unFlags, vExtraDriverData ) ) != FMOD_OK)
{
FMODERR( result );
}
// init timers from garbage collection
m_dwCurrentTime = GetTickCount();
m_dwPreviousTime = GetTickCount();
return true;
}
int CSGD_FModManager::LoadSound(const char *szFilename, FMOD_MODE unMode )
{
if( !m_pSystem ) return -1;
if( !szFilename ) return -1;
int nHandle = -1; // an interger that is returned to the user so they can reference this sound again
int counter = 0; // used to keep track of where in a loop we we're indexing in
// used to catch fMod-specific error codes
FMOD_RESULT result;
vector<tSoundInfo>::iterator vIter = m_SoundList.begin();
while( vIter != m_SoundList.end() )
{
if( _stricmp( (*vIter).filename, szFilename ) == 0 )
{
(*vIter).ref++;
nHandle = counter;
break;
// only hole in this logic:
// what if a sound is loaded that has a different FMOD_MODE?
// has to be taken into account
}
vIter++;
counter++;
}
if( nHandle != -1) return nHandle; // We've found our handle!
// re-initing indexer
counter = 0;
// if one of the already used sounds is done with, reuse that spot
// NOTE:
// (only use this if I can reset each object
while( vIter != m_SoundList.end() )
{
if( (*vIter).ref == 0 )
{
nHandle = counter;
break;
}
vIter++;
counter++;
}
// the sound has not been loaded before,
// so a new one must be made based on this file
tSoundInfo newSound;
if( nHandle == -1 )
{
// copy name into object
strncpy_s( newSound.filename, _MAX_PATH, szFilename, strlen( szFilename ) );
// first instance of this sound
newSound.ref = 1;
// set flags to the sound
newSound.unSoundFormat |= unMode;
// FMOD_DEFAULT uses the defaults. These are the same as FMOD_LOOP_OFF | FMOD_2D | FMOD_HARDWARE
if( ( result = m_pSystem->createSound( newSound.filename, newSound.unSoundFormat, 0, &newSound.fmSound ) ) != FMOD_OK )
{
FMODERR( result );
}
// push new allocated sound onto vector
m_SoundList.push_back( newSound );
return (int)m_SoundList.size() - 1;
}
else
{
// release anything still in m_SoundList[ nHandle ];
// then copy above
}
return nHandle;
}
bool CSGD_FModManager::UnloadSound( int nID )
{
if( !m_pSystem ) return false;
// check that ID is in range
assert( nID > -1 && nID < (int)m_SoundList.size() && "ID is out of range" );
// used to catch fMod-specific error codes
FMOD_RESULT result;
bool bOutcome = false;
if( m_SoundList[nID].ref == 0 || ( result = m_SoundList[nID].fmSound->release() ) == FMOD_OK )
{
ZeroMemory(m_SoundList[nID].filename, _MAX_PATH);
m_SoundList[nID].fmSound = NULL;
m_SoundList[nID].ref = 0;
bOutcome = true;
}
else
FMODERR( result );
return bOutcome;
}
bool CSGD_FModManager::PlaySound( int nID, bool bIsMusic)
{
if( !m_pSystem ) return false;
// check that ID is in range
assert( nID > -1 && nID < (int)m_SoundList.size() && "ID is out of range" );
// Address of a channel handle pointer that receives the newly playing channel
FMOD::Channel *channel;
// used to catch fMod-specific error codes
FMOD_RESULT result;
if( ( result = m_pSystem->playSound(FMOD_CHANNEL_FREE, m_SoundList[ nID ].fmSound , false, &channel) ) != FMOD_OK )
{
FMODERR( result );
}
// hold on to channel pointer for late use
m_SoundList[ nID ].m_SoundChannels.push_back( channel );
if (bIsMusic)
{
SetVolume(nID, (float)(game::GetInstance()->GetMusicLevel()/100.0f));
SetFrequency(nID, (float)(game::GetInstance()->GetFreqLevel()));
}
else
{
SetVolume(nID, (float)(game::GetInstance()->GetSFXLevel()/100.0f));
SetFrequency(nID, (float)(game::GetInstance()->GetFreqLevel()));
}
// return success
return true;
}
bool CSGD_FModManager::ResetSound( int nID )
{
if( !m_pSystem ) return false;
// check that ID is in range
assert( nID > -1 && nID < (int)m_SoundList.size() && "ID is out of range" );
// used to catch fMod-specific error codes
FMOD_RESULT result;
bool bOutcome = false;
// iterate all the channels in this sound
list<FMOD::Channel*>::iterator iter = m_SoundList[nID].m_SoundChannels.begin();
while( iter != m_SoundList[nID].m_SoundChannels.end() )
{
if( ( result = (*iter)->isPlaying( &bOutcome ) ) == FMOD_OK )
{
(*iter)->setPosition( 0, FMOD_TIMEUNIT_MS);
}
iter++;
}
// return the outcome of this function
return bOutcome;
}
bool CSGD_FModManager::StopSound( int nID )
{
if( !m_pSystem ) return false;
// check that ID is in range
assert( nID > -1 && nID < (int)m_SoundList.size() && "ID is out of range" );
// used to catch fMod-specific error codes
FMOD_RESULT result;
bool bOutcome = false;
// iterate all the channels in this sound
list<FMOD::Channel*>::iterator iter = m_SoundList[nID].m_SoundChannels.begin();
while( iter != m_SoundList[nID].m_SoundChannels.end() )
{
if( ( result = (*iter)->isPlaying( &bOutcome ) ) == FMOD_OK )
{
(*iter)->stop( );
}
iter++;
}
// return the outcome of this function
return bOutcome;
}
bool CSGD_FModManager::SetVolume( int nID, float fVolume )
{
if( !m_pSystem ) return false;
// check that ID is in range
assert( nID > -1 && nID < (int)m_SoundList.size() && "ID is out of range" );
// used to catch fMod-specific error codes
FMOD_RESULT result;
bool bOutcome = false;
// iterate all the channels in this sound
list<FMOD::Channel*>::iterator iter = m_SoundList[nID].m_SoundChannels.begin();
while( iter != m_SoundList[nID].m_SoundChannels.end() )
{
if( ( result = (*iter)->isPlaying( &bOutcome ) ) == FMOD_OK )
{
(*iter)->setVolume( fVolume );
}
iter++;
}
// return the outcome of this function
return bOutcome;
}
bool CSGD_FModManager::SetFrequency( int nID, float fFreq )
{
if( !m_pSystem ) return false;
// check that ID is in range
assert( nID > -1 && nID < (int)m_SoundList.size() && "ID is out of range" );
// used to catch fMod-specific error codes
FMOD_RESULT result;
bool bOutcome = false;
// iterate all the channels in this sound
list<FMOD::Channel*>::iterator iter = m_SoundList[nID].m_SoundChannels.begin();
while( iter != m_SoundList[nID].m_SoundChannels.end() )
{
if( ( result = (*iter)->isPlaying( &bOutcome ) ) == FMOD_OK )
{
(*iter)->setFrequency( fFreq );
}
iter++;
}
// return the outcome of this function
return bOutcome;
}
bool CSGD_FModManager::SetPan( int nID, float fPan )
{
if( !m_pSystem ) return false;
// check that ID is in range
assert( nID > -1 && nID < (int)m_SoundList.size() && "ID is out of range" );
// used to catch fMod-specific error codes
FMOD_RESULT result;
bool bOutcome = false;
// iterate all the channels in this sound
list<FMOD::Channel*>::iterator iter = m_SoundList[nID].m_SoundChannels.begin();
while( iter != m_SoundList[nID].m_SoundChannels.end() )
{
if( ( result = (*iter)->isPlaying( &bOutcome ) ) == FMOD_OK )
{
(*iter)->setPan( fPan );
}
iter++;
}
// return the outcome of this function
return bOutcome;
}
bool CSGD_FModManager::IsSoundPlaying( int nID ) {
if( !m_pSystem ) return false;
// check that ID is in range
assert( nID > -1 && nID < (int)m_SoundList.size() && "ID is out of range" );
// used to catch fMod-specific error codes
FMOD_RESULT result;
bool bOutcome = false;
// iterate all the channels in this sound
list<FMOD::Channel*>::iterator iter = m_SoundList[nID].m_SoundChannels.begin();
while( iter != m_SoundList[nID].m_SoundChannels.end() )
{
if( ( result = (*iter)->isPlaying( &bOutcome ) ) == FMOD_OK )
{
break;
}
iter++;
}
// return the outcome of this function
return bOutcome;
}
bool CSGD_FModManager::Update( void )
{
// used to catch fMod-specific error codes
FMOD_RESULT result;
if( ( result = m_pSystem->update() ) != FMOD_OK)
{
FMODERR( result );
}
// TODO: Add garbage collector here
m_dwPreviousTime = m_dwCurrentTime;
m_dwCurrentTime = GetTickCount();
// how much time has past since our last call to update
double dDeltaTime = static_cast<double>( (m_dwCurrentTime - m_dwPreviousTime) / 1000.0f);
m_dTimeAccumulator += dDeltaTime;
// collect garbage fMod handles every few seconds
if( m_dTimeAccumulator >= TIMER_COUNT )
{
ReduceHandleCount( );
// reset accumulation buffer
m_dTimeAccumulator -= TIMER_COUNT;
}
// Success!
return true;
}
void CSGD_FModManager::ReduceHandleCount( void )
{
// used to catch fMod-specific error codes
FMOD_RESULT result;
bool bOutcome = false;
vector<tSoundInfo>::iterator vecIter = m_SoundList.begin();
// for all sound file loaded, check to see on their channel handles
while( vecIter != m_SoundList.end() )
{
list<FMOD::Channel *>::iterator listIter = (*vecIter).m_SoundChannels.begin();
while( listIter != (*vecIter).m_SoundChannels.end() )
{
bOutcome = false;
// if the Handle is invalid, get rid of it
if( ( result = (*listIter)->isPlaying( &bOutcome ) ) == FMOD_ERR_INVALID_HANDLE )
{
listIter = (*vecIter).m_SoundChannels.erase( listIter );
}
else // otherwise, keep moving along the list
listIter++;
} // End of m_SoundChannels loop
vecIter++; // move to next list of handles
} // End of m_SoundList loop
}
bool CSGD_FModManager::ShutdownFModManager( void )
{
// iterate through all sounds
vector<tSoundInfo>::iterator vIter = m_SoundList.begin();
// keep trak of where we are in the vector
int counter = 0;
for( counter = 0; counter < (int)m_SoundList.size(); counter++)
{
// go through vector, releasing all sounds
if( UnloadSound( counter ) ) { }
}
// clear out vector
m_SoundList.clear();
// all done
return true;
}
| [
"[email protected]"
] | [
[
[
1,
451
]
]
] |
7dedfd24e94c079088a85a7449e1492e4a98b113 | 7c4e18dc769ebc3b87d6f45d82812984b7eb6608 | /source/point.h | 1560a0d9ae22c2a0e136d2450d27a15a80a68783 | [] | no_license | ishahid/smartmap | 5bce0ca5690efb5b8e28c561d86321c8c5dcc794 | 195b1ebb03cd786d38167d622e7a46c7603e9094 | refs/heads/master | 2020-03-27T05:43:49.428923 | 2010-07-06T08:24:59 | 2010-07-06T08:24:59 | 10,093,280 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 267 | h | #ifndef POINT_H
#define POINT_H
class Point {
protected:
double _x;
double _y;
public:
Point( double px=0, double py=0 );
double x();
double y();
void setX( double px );
void setY( double py );
void setXY( double px, double py );
};
#endif
| [
"none@none"
] | [
[
[
1,
17
]
]
] |
621763d42b9da10eb453177765d113514e357c2b | 4d01363b089917facfef766868fb2b1a853605c7 | /src/Physics/CollisionDetector.h | 1e15b6076e829a197fc44f0fd94b5502c65d1c1b | [] | no_license | FardMan69420/aimbot-57 | 2bc7075e2f24dc35b224fcfb5623083edcd0c52b | 3f2b86a1f86e5a6da0605461e7ad81be2a91c49c | refs/heads/master | 2022-03-20T07:18:53.690175 | 2009-07-21T22:45:12 | 2009-07-21T22:45:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,251 | h | #ifndef collisiondetector_h
#define collisiondetector_h
#include <vector>
#include "../Utils/Structures/Position3.h"
#include "../SceneObjects/Meshes/Mesh.h"
#include "../SceneObjects/Meshes/Hitbox.h"
#include "../Utils/Structures/KDTree.h"
class CollisionDetector
{
private:
float radius;
vector<Position3> nearbyCentres;
vector<Mesh> nearbyMeshes;
public:
CollisionDetector()
{
radius = 100;
}
bool areCollided(Position3& p)
{
// get a list of all meshes somehow, or perhaps even a subset depending on how many there will be or how
// computationally slow getting the list is
vector<Mesh> allMeshes;
for(int i = 0; i < allMeshes.size(); i++)
{
if (((allMeshes.at(i).getCentre().x - p.x) < radius) || ((allMeshes.at(i).getCentre().y - p.y) < radius) || ((allMeshes.at(i).getCentre().z - p.z) < radius))
{
nearbyCentres.push_back(allMeshes.at(i).getCentre());
}
}
KDTree* tree = new KDTree(nearbyCentres);
vector<Position3> traversal = tree->getTraversal();
return false;
}
bool areCollided(Position3& p, Mesh* mesh)
{
return false;
}
inline bool areCollided(Hitbox* hitbox, Mesh* mesh)
{
return false;
}
};
#endif
| [
"daven.hughes@92c3b6dc-493d-11de-82d9-516ade3e46db"
] | [
[
[
1,
64
]
]
] |
10aab54cfcfcc41425f03316cb061a8a0b7a6b78 | eb8a27a2cc7307f0bc9596faa4aa4a716676c5c5 | /WinEditionWithJRE/browser-lcc/jscc/src/v8/v8/src/dtoa.h | 8853d29cd00afd6c89c50316c5033b05885be1d6 | [
"BSD-3-Clause",
"bzip2-1.0.6",
"Artistic-1.0",
"LicenseRef-scancode-public-domain",
"Artistic-2.0"
] | permissive | baxtree/OKBuzzer | c46c7f271a26be13adcf874d77a7a6762a8dc6be | a16e2baad145f5c65052cdc7c767e78cdfee1181 | refs/heads/master | 2021-01-02T22:17:34.168564 | 2011-06-15T02:29:56 | 2011-06-15T02:29:56 | 1,790,181 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,502 | h | // Copyright 2010 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef V8_DTOA_H_
#define V8_DTOA_H_
namespace v8 {
namespace internal {
enum DtoaMode {
// Return the shortest correct representation.
// For example the output of 0.299999999999999988897 is (the less accurate but
// correct) 0.3.
DTOA_SHORTEST,
// Return a fixed number of digits after the decimal point.
// For instance fixed(0.1, 4) becomes 0.1000
// If the input number is big, the output will be big.
DTOA_FIXED,
// Return a fixed number of digits, no matter what the exponent is.
DTOA_PRECISION
};
// The maximal length of digits a double can have in base 10.
// Note that DoubleToAscii null-terminates its input. So the given buffer should
// be at least kBase10MaximalLength + 1 characters long.
static const int kBase10MaximalLength = 17;
// Converts the given double 'v' to ascii.
// The result should be interpreted as buffer * 10^(point-length).
//
// The output depends on the given mode:
// - SHORTEST: produce the least amount of digits for which the internal
// identity requirement is still satisfied. If the digits are printed
// (together with the correct exponent) then reading this number will give
// 'v' again. The buffer will choose the representation that is closest to
// 'v'. If there are two at the same distance, than the one farther away
// from 0 is chosen (halfway cases - ending with 5 - are rounded up).
// In this mode the 'requested_digits' parameter is ignored.
// - FIXED: produces digits necessary to print a given number with
// 'requested_digits' digits after the decimal point. The produced digits
// might be too short in which case the caller has to fill the gaps with '0's.
// Example: toFixed(0.001, 5) is allowed to return buffer="1", point=-2.
// Halfway cases are rounded towards +/-Infinity (away from 0). The call
// toFixed(0.15, 2) thus returns buffer="2", point=0.
// The returned buffer may contain digits that would be truncated from the
// shortest representation of the input.
// - PRECISION: produces 'requested_digits' where the first digit is not '0'.
// Even though the length of produced digits usually equals
// 'requested_digits', the function is allowed to return fewer digits, in
// which case the caller has to fill the missing digits with '0's.
// Halfway cases are again rounded away from 0.
// 'DoubleToAscii' expects the given buffer to be big enough to hold all digits
// and a terminating null-character. In SHORTEST-mode it expects a buffer of
// at least kBase10MaximalLength + 1. Otherwise, the size of the output is
// limited to requested_digits digits plus the null terminator.
void DoubleToAscii(double v, DtoaMode mode, int requested_digits,
Vector<char> buffer, int* sign, int* length, int* point);
} } // namespace v8::internal
#endif // V8_DTOA_H_
| [
"[email protected]"
] | [
[
[
1,
85
]
]
] |
6da4e57fcfd30de64829526efb3ddd0e5675421e | 971b000b9e6c4bf91d28f3723923a678520f5bcf | /PaperSizeScroll/_snip_pieces/xsl-fo_open/modules/ooo/oo_handler.h | 9eed291604b43de8421be60b16b64c4f7c0b2ad3 | [] | no_license | google-code-export/fop-miniscribus | 14ce53d21893ce1821386a94d42485ee0465121f | 966a9ca7097268c18e690aa0ea4b24b308475af9 | refs/heads/master | 2020-12-24T17:08:51.551987 | 2011-09-02T07:55:05 | 2011-09-02T07:55:05 | 32,133,292 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,405 | h | /*******************************************************************************
* class OO_Handler
*******************************************************************************
* Copyright (C) 2008 by Peter Hohl Porting to QT4
* e-Mail: [email protected] www.qmake.net
* Copyright (C) 2006 by Tobias Koenig <[email protected]> KDE Okular
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*******************************************************************************/
#ifndef OO_HANDLER_H
#define OO_HANDLER_H
#include <QDomText>
#include <QDomElement>
#include <QtCore>
#include <QDebug>
#include <QCoreApplication>
#include <QObject>
#include <QApplication>
#include <QXmlSimpleReader>
#include <QXmlInputSource>
#include "quazip.h"
#include "quazipfile.h"
#include "oo_document.h"
#include "styleparser.h"
#include "styleinformation.h"
#include <QDomDocument>
#include <QDomElement>
#include <QDomImplementation>
#include <QDomProcessingInstruction>
#include <QtGui/QTextBrowser>
namespace OOO {
//
class OO_Handler : public QObject
{
Q_OBJECT
//
public:
OO_Handler( const QString filedoc );
QString text();
bool ParseFiles();
inline QTextDocument *document() { return mTextDocument; }
inline QMap<QString,QByteArray> imagelist() { return ooimage; }
inline QMap<QString,QByteArray> fileziplist() { return ooFile; }
protected:
void OpenFile( const QString filedoc );
bool havingdoc;
QString log;
QStringList filelist;
QMap<QString,QByteArray> ooimage;
QMap<QString,QByteArray> ooFile;
private:
bool convertBody( const QDomElement &element );
bool convertText( const QDomElement &element );
bool convertHeader( QTextCursor *cursor, const QDomElement &element );
bool convertParagraph( QTextCursor *cursor, const QDomElement &element, const QTextBlockFormat &format = QTextBlockFormat(), bool merge = false );
bool convertTextNode( QTextCursor *cursor, const QDomText &element, const QTextCharFormat &format );
bool convertSpan( QTextCursor *cursor, const QDomElement &element, const QTextCharFormat &format );
bool convertList( const QDomElement &element );
bool convertTable( const QDomElement &element );
bool convertFrame( const QDomElement &element );
bool convertLink( QTextCursor *cursor, const QDomElement &element, const QTextCharFormat &format );
bool convertAnnotation( QTextCursor *cursor, const QDomElement &element );
QTextDocument *mTextDocument;
QTextCursor *mCursor;
StyleInformation *mStyleInformation;
void setError( QString msg );
signals:
void errorFound(QString);
public slots:
};
}
//
#endif // OO_HANDLER_H
| [
"ppkciz@9af58faf-7e3e-0410-b956-55d145112073"
] | [
[
[
1,
99
]
]
] |
8b645c3cd8216717fbd4ef44b89be3b7152fbdd5 | 155c4955c117f0a37bb9481cd1456b392d0e9a77 | /LirGenerators/LlvmIRGenerator.cpp | b67aae12eafa41b5ef67ec93c272ab09bcc1de28 | [] | no_license | zwetan/tessa | 605720899aa2eb4207632700abe7e2ca157d19e6 | 940404b580054c47f3ced7cf8995794901cf0aaa | refs/heads/master | 2021-01-19T19:54:00.236268 | 2011-08-31T00:18:24 | 2011-08-31T00:18:24 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 183,517 | cpp |
/***
* Go through each TESSA instruction and lazily create LLVM IR Instructions
* We also lazily create LLVM basic Blocks, instructions, etc
* This is designed to compile only one method at a time
*/
#define __USING_LLVM__ // Need this since LLVM redefines int8_t
#include "LirGenerators.h" // Include LLVM stuff BEFORE defining Tamarin stuff because of datatype conflicts
#include "VMCPPWrapperDefinitions.h"
/***
* NOTE NOTE NOTE:
* Some of the object names in Tessa collide with LLVM (e.g. BasicBlock).
* In these cases, we ALWAYS ALWAYS ALWAYS with using namespace llvm
* and fully qualify TessaVM objects
*/
/***
* Rules of the game:
* We assume that the following rules apply between EACH visit function:
* All types are coerced back to the native LLVM types at each visit() method. It is the responsibility of the
* visit() to coerce the types back to their native types.
* ints -> intType
* uint -> uintType
* double -> doubleType
* Any pointer -> pointerType
* eg if the visit() calls out to the VM and returns a ScriptObject*, the visit() should recast
* the ScriptObject* -> pointerType.
*
* Biggest trick is that Tamarin assumes booleans are 32 bit integers. Llvm wants booleans to be 1 bit integers.
* So we have to cast between 32 bit and 1 bit integers for boolean values when loading/storing to/from arguments arrays
* and return values
*/
/***
* Performance penalty notes:
* Be wary of allocating anything on the stack. If you over allocate, the GC thinks some value on the stack may be alive,
* and you get massive performance penalties during the GC phases.
*/
namespace LirGenerators {
using namespace llvm;
using namespace TessaVM;
using namespace TessaInstructions;
using namespace avmplus;
LlvmIRGenerator::LlvmIRGenerator(avmplus::AvmCore* core, Module* module, llvm::Function* llvmFunction) {
this->core = core;
this->gc = core->gc;
_tessaValueToLlvmValueMap = new (gc) avmplus::GCSortedMap<TessaValue*, llvm::Value*, avmplus::LIST_NonGCObjects> (gc);
_tessaToLlvmBasicBlockMap = new (gc) GCSortedMap<TessaVM::BasicBlock*, llvm::BasicBlock*, avmplus::LIST_NonGCObjects>(gc);
_tessaToEndLlvmBasicBlockMap = new (gc) GCSortedMap<TessaVM::BasicBlock*, llvm::BasicBlock*, avmplus::LIST_NonGCObjects>(gc);
_methodEnvCallStack = new (gc) List<llvm::Value*, avmplus::LIST_NonGCObjects>(gc);
_toplevelPointerStack = new (gc) avmplus::List<llvm::Value*, avmplus::LIST_NonGCObjects>(gc);
_methodEnvScopeChainStack = new (gc) avmplus::List<llvm::Value*, avmplus::LIST_NonGCObjects>(gc);
_methodEnvVTableStack = new (gc) avmplus::List<llvm::Value*, avmplus::LIST_NonGCObjects>(gc);
_scopeStackCallStack = new (gc) avmplus::List<llvm::Value*, avmplus::LIST_NonGCObjects>(gc);
_scopeStackCountStack = new (gc) avmplus::List<llvm::Value*, avmplus::LIST_NonGCObjects>(gc);
_methodInfoStack = new (gc) avmplus::List<MethodInfo*, avmplus::LIST_GCObjects>(gc);
_tessaTypeFactory = TypeFactory::getInstance();
TessaAssert(llvmFunction != NULL);
TessaAssert(module != NULL);
this->_llvmFunction = llvmFunction;
this->_module = module;
context = &module->getContext();
// Use known types
_atomType = llvm::Type::getInt32Ty(*context);
_intType = llvm::Type::getInt32Ty(*context);
_pointerType = llvm::Type::getInt32PtrTy(*context);
_doublePointerType = llvm::Type::getDoublePtrTy(*context);
_doubleType = llvm::Type::getDoubleTy(*context);
_uintType = llvm::Type::getInt32Ty(*context);
_booleanType = llvm::Type::getInt1Ty(*context);
_booleanPointerType = llvm::Type::getInt1PtrTy(*context);
_voidType = llvm::Type::getVoidTy(*context);
_returnCount = 0;
}
LlvmIRGenerator::~LlvmIRGenerator() {
}
void LlvmIRGenerator::putValue(TessaValue* tessaValue, llvm::Value* llvmValue) {
TessaAssert(tessaValue != NULL);
TessaAssert(llvmValue != NULL);
// We can overwrite the beginning parameter instructions multiple times due to the way the arguments work. Other than that, no
if (tessaValue->isInstruction()) {
TessaInstruction* instruction = static_cast<TessaInstruction*>(tessaValue);
if (!(((currentBasicBlock->getBasicBlockId() == 0) && instruction->isParameter()))) {
TessaAssert(!_tessaValueToLlvmValueMap->containsKey(instruction));
}
}
_tessaValueToLlvmValueMap->put(tessaValue, llvmValue);
}
void LlvmIRGenerator::debugMessage(std::string message) {
#ifdef DEBUG
if (core->config.tessaVerbose) {
printf("%s\n", message.data());
}
#endif
}
llvm::Value* LlvmIRGenerator::getValue(TessaValue* value) {
if (value->isConstantValue()) {
llvm::Value* llvmConstantValue;
ConstantValue* constantValue = static_cast<ConstantValue*>(value);
if (constantValue->isPointer()) {
TessaTypes::ConstantPtr* constPtr = static_cast<ConstantPtr*>(constantValue);
llvmConstantValue = createConstantPtr(constPtr->getValue());
_tessaValueToLlvmValueMap->put(value, llvmConstantValue);
}
}
TessaAssert(value != NULL);
TessaAssert(containsLlvmValue(value));
return _tessaValueToLlvmValueMap->get(value);
}
bool LlvmIRGenerator::containsLlvmValue(TessaValue* tessaValue) {
return _tessaValueToLlvmValueMap->containsKey(tessaValue);
}
llvm::Function* LlvmIRGenerator::getLlvmFunction(const LlvmCallInfo* llvmCallInfo) {
llvm::Function* functionToGet = this->_module->getFunction(llvmCallInfo->methodName);
TessaAssert(functionToGet != NULL);
return functionToGet;
}
llvm::ConstantInt* LlvmIRGenerator::createConstantInt(int integerValue) {
bool isSigned = true;
return llvm::ConstantInt::get(llvm::Type::getInt32Ty(*context), integerValue, isSigned);
}
llvm::ConstantInt* LlvmIRGenerator::createConstantUnsignedInt(uint32_t integerValue) {
bool isSigned = false;
return llvm::ConstantInt::get(llvm::Type::getInt32Ty(*context), integerValue, isSigned);
}
llvm::ConstantInt* LlvmIRGenerator::createConstantBoolean(bool value) {
bool isSigned = false;
return llvm::ConstantInt::get(_booleanType, value, isSigned);
}
llvm::IntToPtrInst* LlvmIRGenerator::createConstantPtr(intptr_t pointer) {
llvm::ConstantInt* address = createConstantInt(pointer);
return castIntToPtr(address, "");
}
llvm::Constant* LlvmIRGenerator::createConstantDouble(double doubleValue) {
return llvm::ConstantFP::get(_doubleType, doubleValue);
}
llvm::IntToPtrInst* LlvmIRGenerator::castIntToPtr(llvm::Value* integer, std::string castName = "") {
TessaAssert(llvmBasicBlock != NULL);
TessaAssert(integer->getType()->isIntegerTy());
return new llvm::IntToPtrInst(integer, _pointerType, castName, llvmBasicBlock);
}
llvm::PtrToIntInst* LlvmIRGenerator::castPtrToInt(llvm::Value* pointer, std::string castName = "") {
TessaAssert(pointer->getType()->isPointerTy());
return new llvm::PtrToIntInst(pointer, _atomType, castName, llvmBasicBlock);
}
/***
* Returns the loaded value as whatever type the pointer points to
*/
llvm::Instruction* LlvmIRGenerator::createLlvmLoad(llvm::Value* pointer, int offset, llvm::BasicBlock* basicBlockToInsert) {
llvm::Value* llvmOffset = createConstantInt(offset);
llvm::GetElementPtrInst* addressCalculation = llvm::GetElementPtrInst::Create(pointer, llvmOffset, "", basicBlockToInsert);
return new llvm::LoadInst(addressCalculation, "", basicBlockToInsert);
}
// Returns loaded value as an int
llvm::Instruction* LlvmIRGenerator::createLlvmLoad(llvm::Value* pointer, int offset) {
llvm::Value* llvmPointer = pointer;
TessaAssert(pointer->getType()->isPointerTy());
if (pointer->getType() != _pointerType) {
llvmPointer = createBitCast(pointer, _pointerType);
}
return createLlvmLoad(llvmPointer, offset, llvmBasicBlock);
}
// Returns loaded value as a double
llvm::Instruction* LlvmIRGenerator::createLlvmLoadDouble(llvm::Value* pointer, int offset) {
llvm::Value* llvmPointer = createBitCast(pointer, _doublePointerType);
return createLlvmLoad(llvmPointer, offset, llvmBasicBlock);
}
// Returns loaded value as a boolean
llvm::Instruction* LlvmIRGenerator::createLlvmLoadBoolean(llvm::Value* pointer, int offset) {
llvm::Value* llvmPointer = createBitCast(pointer, _booleanPointerType);
return createLlvmLoad(llvmPointer, offset, llvmBasicBlock);
}
// Returns loaded value as a pointer
llvm::Instruction* LlvmIRGenerator::createLlvmLoadPtr(llvm::Value* pointer, int offset) {
return castIntToPtr(createLlvmLoad(pointer, offset));
}
// Returns the calculated address as a pointer value
llvm::Instruction* LlvmIRGenerator::doPointerArithmetic(llvm::Value* pointer, int offset) {
llvm::Value* base = pointer;
if (pointer->getType()->isPointerTy()) {
base = castPtrToInt(pointer);
}
TessaAssert(base->getType()->isIntegerTy());
llvm::Value* addedAddress = llvm::BinaryOperator::Create(Instruction::Add, base, createConstantInt(offset), "", llvmBasicBlock);
return castIntToPtr(addedAddress);
}
/***
* Stores the valueToStore into the pointer[offset].
* Here offset is defined as the offset that the llvm GEP instruction will use in address calculation
* This assumes that pointer and value to store are of the correct type already
*/
void LlvmIRGenerator::createLlvmStore(llvm::Value* pointer, llvm::Value* valueToStore, int offset) {
TessaAssert(pointer->getType()->isPointerTy());
TessaAssertMessage(valueToStore->getType() == pointer->getType()->getContainedType(0), "Probably didn't cast value to the llvm pointer type");
llvm::Value* llvmOffset = createConstantInt(offset);
llvm::GetElementPtrInst* addressCalculation = llvm::GetElementPtrInst::Create(pointer, llvmOffset, "", llvmBasicBlock);
new llvm::StoreInst(valueToStore, addressCalculation, llvmBasicBlock);
}
void LlvmIRGenerator::createLlvmStoreInt(llvm::Value* pointer, llvm::Value* valueToStore, int offset) {
llvm::Value* llvmPointer = pointer;
const llvm::Type* pointsToType = pointer->getType()->getContainedType(0);
TessaAssert(valueToStore->getType()->isIntegerTy());
if (pointsToType != _intType) {
llvmPointer = createBitCast(pointer, _pointerType);
}
//TessaAssert(pointsToType->isPointerTy());
createLlvmStore(llvmPointer, valueToStore, offset);
}
void LlvmIRGenerator::createLlvmStoreDouble(llvm::Value* pointer, llvm::Value* valueToStore, int offset) {
llvm::Value* llvmPointer = pointer;
TessaAssert(valueToStore->getType()->isDoubleTy());
const llvm::Type* pointsToType = pointer->getType()->getContainedType(0);
if (pointsToType != _doublePointerType) {
llvmPointer = createBitCast(pointer, _doublePointerType);
}
createLlvmStore(llvmPointer, valueToStore, offset);
}
void LlvmIRGenerator::createLlvmStorePointer(llvm::Value* pointer, llvm::Value* valueToStore, int offset) {
llvm::Value* llvmPointer = pointer;
const llvm::Type* pointsToType = pointer->getType()->getContainedType(0);
TessaAssert(pointsToType->isPointerTy());
TessaAssert(valueToStore->getType()->isPointerTy());
if (pointsToType != _pointerType) {
llvmPointer = createBitCast(pointer, _pointerType);
}
createLlvmStore(llvmPointer, valueToStore, offset);
}
llvm::CallInst* LlvmIRGenerator::createLlvmCallInstruction(const LlvmCallInfo* llvmCallInfo, int argCount, ...) {
llvm::Function* functionToCall = getLlvmFunction(llvmCallInfo);
std::string functionName = functionToCall->getName();
std::vector<llvm::Value*> arguments;
va_list ap;
va_start(ap, argCount);
for (int i = 0; i < argCount; i++) {
arguments.push_back( va_arg(ap, llvm::Value*) );
}
va_end(ap);
return createLlvmCallInstruction(functionToCall, functionToCall->getFunctionType(), functionName, &arguments, llvmCallInfo->callingConvention);
}
/***
* This creates a call to an indirect address which is supplied as the first argument.
* This also assumes that the calling convention is CDECL
*
* IndirectAddress parameter must be a function pointer.
*/
llvm::CallInst* LlvmIRGenerator::createLlvmIndirectCallInstruction(llvm::Value* indirectAddress, const llvm::FunctionType* functionType, std::string functionName, int argCount, ...) {
std::vector<llvm::Value*> arguments;
va_list ap;
va_start(ap, argCount);
for (int i = 0; i < argCount; i++) {
arguments.push_back( va_arg(ap, llvm::Value*) );
}
va_end(ap);
TessaAssertMessage(indirectAddress->getType()->isPointerTy(), "Indirect address must be a pointer type");
llvm::PointerType* functionPointerType = llvm::PointerType::get(functionType, 0);
llvm::Value* functionPointerInstance = createBitCast(indirectAddress, functionPointerType);
return createLlvmCallInstruction(functionPointerInstance, functionType, functionName, &arguments, ABI_CDECL);
}
/***
* As a side affect, this casts the arguments to the type required by the llvm::function signature
*/
llvm::CallInst* LlvmIRGenerator::createLlvmCallInstruction(llvm::Value* valueToCall, const llvm::FunctionType* functionType, std::string functionName, std::vector<llvm::Value*>* arguments, AbiKind abiKind) {
TessaAssertMessage(arguments->size() == functionType->getNumParams(), "Incorrect number of parameters");
std::vector<llvm::Value*> castedArguments;
castCallArgumentsToDeclaredTypes(&castedArguments, functionType, arguments);
if (functionType->getReturnType()->isVoidTy()) {
functionName = ""; // Void types can't have function names
}
llvm::CallInst* callInstruction = CallInst::Create(valueToCall, castedArguments.begin(), castedArguments.end(), functionName, llvmBasicBlock);
setLlvmCallingConvention(callInstruction, abiKind);
return callInstruction;
}
void LlvmIRGenerator::castCallArgumentsToDeclaredTypes(std::vector<llvm::Value*>* castedArgumentsLocation, const llvm::FunctionType* functionType, std::vector<llvm::Value*>* arguments) {
for (uint32_t i = 0; i < functionType->getNumParams(); i++) {
const llvm::Type* functionParamType = functionType->getParamType(i);
llvm::Value* argumentValue = arguments->at(i);
const llvm::Type* argumentParamType = argumentValue->getType();
if (functionParamType != argumentParamType) {
// Zero extend booleans to the proper integer value
if (functionParamType->isIntegerTy() && (argumentParamType == llvm::Type::getInt1Ty(*context))) {
castedArgumentsLocation->push_back(llvm::ZExtInst::Create(llvm::Instruction::ZExt, argumentValue, functionParamType, "", llvmBasicBlock));
} else {
castedArgumentsLocation->push_back(new llvm::BitCastInst(argumentValue, functionParamType, "", this->llvmBasicBlock));
}
} else {
castedArgumentsLocation->push_back(argumentValue);
}
}
}
void LlvmIRGenerator::setLlvmCallingConvention(llvm::CallInst* callInstruction, AbiKind callingConvention) {
switch (callingConvention) {
case ABI_THISCALL:
callInstruction->setCallingConv(llvm::CallingConv::X86_ThisCall);
break;
case ABI_FASTCALL:
callInstruction->setCallingConv(llvm::CallingConv::X86_FastCall);
break;
default:
callInstruction->setCallingConv(llvm::CallingConv::C);
break;
}
}
// emit code to create a stack-allocated copy of the given multiname.
// this helper only initializes Multiname.flags and Multiname.next_index
llvm::Value* LlvmIRGenerator::copyMultiname(const Multiname* multiname) {
llvm::Value* stackAllocatedMultiname = new llvm::AllocaInst(_intType, createConstantInt(sizeof(Multiname)), "MultinameCopy", llvmBasicBlock);
createLlvmStore(stackAllocatedMultiname, createConstantInt(multiname->ctFlags()), offsetof(Multiname, flags) / sizeof(int32_t));
createLlvmStore(stackAllocatedMultiname, createConstantInt(multiname->next_index), offsetof(Multiname, next_index) / sizeof(int32_t));
return stackAllocatedMultiname;
}
llvm::Value* LlvmIRGenerator::initMultiname(const Multiname* multiname, TessaInstruction* namespaceInstruction, bool isDeleteProp = false) {
if (!multiname->isRuntime()) {
// use the precomputed multiname
return createConstantPtr((intptr_t)multiname);
}
// create an initialize a copy of the given multiname
llvm::Value* stackMultinameCopy = copyMultiname(multiname);
// then initialize its name and ns|nsset fields.
llvm::Value* nameAtom = NULL;
if (multiname->isRtname()) {
nameAtom = getValue(namespaceInstruction);
} else {
// copy the compile-time name to the temp name
llvm::Value* mName = createConstantPtr((intptr_t)multiname->name);
createLlvmStore(stackMultinameCopy, mName, offsetof(Multiname,name) / sizeof(int32_t));
}
if (multiname->isRtns()) {
// intern the runtime namespace and copy to the temp multiname
TessaAssert(false);
/*
llvm::Value* namespaceAtom = loadAtomRep(csp--);
LIns* internNs = callIns(FUNCTIONID(internRtns), 2, env_param, nsAtom);
stp(internNs, _tempname, offsetof(Multiname,ns), ACC_OTHER);
*/
} else {
// copy the compile-time namespace to the temp multiname
//llvm::Value* namespaceValue = createConstantPtr((intptr_t)multiname->ns);
llvm::Value* namespaceValue = createConstantInt((intptr_t)multiname->ns);
createLlvmStore(stackMultinameCopy, namespaceValue, offsetof(Multiname, ns) / sizeof(int32_t));
}
// Call initMultinameLate as the last step, since if a runtime
// namespace is present, initMultinameLate may clobber it if a
// QName is provided as index.
if (nameAtom) {
if (isDeleteProp) {
//callIns(FUNCTIONID(initMultinameLateForDelete), 3, env_param, _tempname, nameAtom);
TessaAssert(false);
} else {
createLlvmCallInstruction(GET_LLVM_CALLINFO(InitMultinameLate), 3, _avmcorePointer, stackMultinameCopy, nameAtom);
}
}
return stackMultinameCopy;
}
/***
* LLVM's alloc instruction works a bit differently than nanojits.
* NanoJIT allocs space on the stack only ONCE per alloc.
* LLvm will alloc per ALLOC instruction. So if there is a loop, with an alloc in it, nanojit
* will use the same alloced space over and over again. LLVM will keep allocing the requested space.
* This blows up the stack space in LLVM. So go through the function, and allocate one block for ALL
* the arguments pointers ever to be used at the jit code prologue.
*/
llvm::Value* LlvmIRGenerator::allocateArgumentsPointer(List<TessaVM::BasicBlock*, LIST_GCObjects>* basicBlocks) {
maxArgPointerSize = 0;
for (uint32_t i = 0; i < basicBlocks->size(); i++) {
TessaVM::BasicBlock* currentBasicBlock = basicBlocks->get(i);
List<TessaInstruction*, avmplus::LIST_GCObjects>* instructions = currentBasicBlock->getInstructions();
for (uint32_t j = 0; j < instructions->size(); j++) {
TessaInstruction* currentInstruction = instructions->get(j);
if (currentInstruction->isArrayOfInstructions()) {
ArrayOfInstructions* arrayOfInstructions = (ArrayOfInstructions*) currentInstruction;
int size = arrayOfInstructions->size();
if (size > (int)maxArgPointerSize) {
maxArgPointerSize = size;
}
}
else if (currentInstruction->isNewArray()) {
NewArrayInstruction* newArray = (NewArrayInstruction*) currentInstruction;
int arraySize = newArray->numberOfElements();
if (arraySize > (int) maxArgPointerSize) {
maxArgPointerSize = arraySize;
}
}
}
}
/***
* We only count for the number of arguments here, which may all be doubles.
* However, LLVM alloc here thinks we are a pointer size. So double the allocation size
* to potentially accomodate all native doubles;
*/
TessaAssert((sizeof(double) / 2) == sizeof(int));
maxArgPointerSize = maxArgPointerSize * 2;
llvm::Value* allocSize = createConstantInt(maxArgPointerSize);
return new llvm::AllocaInst(_pointerType, allocSize, "Args Pointer", llvmBasicBlock);
}
void LlvmIRGenerator::setMethodEnvPointers() {
_methodEnvScopeChain = createLlvmLoadPtr(_envPointer, offsetof(MethodEnv, _scope) / sizeof(int32_t));
_methodEnvVTable = createLlvmLoadPtr(_methodEnvScopeChain, offsetof(ScopeChain, _vtable) / sizeof(int32_t));
_toplevelPointer = createLlvmLoadPtr(_methodEnvVTable, offsetof(VTable, _toplevel) / sizeof(int32_t));
_methodEnvCallStack->add(_envPointer);
_methodEnvVTableStack->add(_methodEnvVTable);
_methodEnvScopeChainStack->add(_methodEnvScopeChain);
_toplevelPointerStack->add(_toplevelPointer);
};
void LlvmIRGenerator::insertConstantAtoms(TessaVM::ASFunction* asFunction) {
TessaAssert(llvmBasicBlock != NULL);
_envPointer = _llvmFunction->arg_begin();
setMethodEnvPointers();
_avmcorePointer = createConstantPtr((intptr_t)this->core);
_falseAtom = createConstantInt(AtomConstants::falseAtom);
_trueAtom = createConstantInt(AtomConstants::trueAtom);
_undefinedAtom = createConstantInt(AtomConstants::undefinedAtom);
_nullObjectAtom = createConstantInt(AtomConstants::nullObjectAtom);
// Allocing 0 is undefined
if (asFunction->getScopeStackSize() != 0) {
llvm::Value* maxScopeStack = createConstantInt(asFunction->getScopeStackSize());
_scopeStack = new llvm::AllocaInst(_pointerType, maxScopeStack, "Scope Stack", llvmBasicBlock);
} else {
_scopeStack = new llvm::AllocaInst(_pointerType, createConstantInt(1), "Scope Stack", llvmBasicBlock);
}
_currentScopeDepth = createConstantInt(0);
}
const llvm::Type* LlvmIRGenerator::getLlvmType(TessaTypes::Type* tessaType) {
if (tessaType->isNumber()) {
return _doubleType;
} else if (tessaType->isUnsignedInt()) {
return _uintType;
} else if (tessaType->isInteger()) {
return _intType;
} else if (tessaType->isPointer()) {
return _pointerType;
} else if (tessaType->isObject()) {
// This seems like a bug. Shouldn't objects be Atoms?
//TessaAssert(false);
return _atomType;
} else if (tessaType->isBoolean()) {
return _booleanType;
} else if (tessaType->isAnyType()) {
return _atomType;
} else {
return _atomType;
}
}
/***
* Fetches the appropriate pointer type for the given tessa type used in GEP/Load/STore llvm instructions
*/
const llvm::Type* LlvmIRGenerator::getPointerType(TessaTypes::Type* tessaType) {
if (tessaType->isPointer()) {
return _pointerType;
} else if (tessaType->isNumber()) {
return _doubleType;
} else {
return _atomType;
}
}
void LlvmIRGenerator::buildJitTimeOptionalParameter(TessaInstruction* parameter, Atom defaultValue, int parameterIndex, int optionalIndex, int requiredCount, int displacement, TessaVM::BasicBlock* preOptionalBlock) {
char paramName[32];
VMPI_snprintf(paramName, sizeof(paramName), "Opt Param %d", parameterIndex);
llvm::Argument* argCount = getArgCountParameter();
llvm::Argument* argParameters = getAtomArgumentsParameter();
/***
* Each optional parameter is an allocated stack value. Store the default value at stack location.
* Check if arg count > optional count, if so load the arg and store it back into the allocated stack slot.
* Then reload the stack slot.
*
* Build the C equivalent of:
* if (argCount > requiredParameters) {
* locals[optionalIndex] = arguments[required_index + optionalIndex];
* }
* localVar = locals[optionalIndex];
*
*/
TessaTypes::Type* nativeType = parameter->getType();
const llvm::Type* llvmPointerType = getPointerType(nativeType);
// Store locals[argument] = defaultValue
// May have to store a double type
int paramSize = sizeof(double) / sizeof(int32_t);
TessaAssert(paramSize != 0);
llvm::Value* paramLocation = new llvm::AllocaInst(llvmPointerType, createConstantInt(paramSize), paramName, llvmBasicBlock);
llvm::Value* llvmDefaultValue = createConstantInt(defaultValue);
llvmDefaultValue = atomToNative(llvmDefaultValue, nativeType);
if (parameter->isBoolean()) {
llvmDefaultValue = castBooleanToNative(llvmDefaultValue, _tessaTypeFactory->integerType());
}
createLlvmStore(paramLocation, llvmDefaultValue, 0);
// then generate: if (argc > p) local[p+1] = arg[p+1], so overwrite only if it exists
llvm::BasicBlock* optionalBasicBlock = llvm::BasicBlock::Create(*context, "", _llvmFunction);
llvm::BasicBlock* mergeBlock = llvm::BasicBlock::Create(*context, "", _llvmFunction);
// if (argCount > requiredParameterCount)
llvm::Value* ifCondition = new ICmpInst(*llvmBasicBlock, ICmpInst::ICMP_SGT, argCount, createConstantInt(optionalIndex + requiredCount), "");
llvm::Value* branchInstruction = llvm::BranchInst::Create(optionalBasicBlock, mergeBlock, ifCondition, llvmBasicBlock);
// We are now in the if arguments
// unboxedValue = arguments[paramCount + 1]
// This is really pointer arithmetic, [stackAddress + displacement]
llvm::Value* argParametersInt = new llvm::PtrToIntInst(argParameters, _intType, paramName, optionalBasicBlock);
llvm::Value* loadLocationInteger = llvm::BinaryOperator::Create(Instruction::Add, argParametersInt, createConstantInt(displacement), "", optionalBasicBlock);
llvm::Value* loadLocationPointer;
if (parameter->isPointer()) {
loadLocationPointer = new llvm::IntToPtrInst(loadLocationInteger, llvmPointerType, "", optionalBasicBlock);
} else if (parameter->isNumber()) {
loadLocationPointer = new llvm::IntToPtrInst(loadLocationInteger, _pointerType, "", optionalBasicBlock);
loadLocationPointer = new llvm::BitCastInst(loadLocationPointer, _doublePointerType, "", optionalBasicBlock);
} else {
// Integers and uints aren't pointers, but we have to trick llvm into thinking they are so we can actually do a load
loadLocationPointer = new llvm::IntToPtrInst(loadLocationInteger, _pointerType, "", optionalBasicBlock);
}
llvm::Value* loadedNativeValue = new llvm::LoadInst(loadLocationPointer, "", optionalBasicBlock);
if (parameter->isPointer()) {
// Load returns an integer :(
loadedNativeValue = new llvm::IntToPtrInst(loadedNativeValue, _pointerType, paramName, optionalBasicBlock);
} else if (parameter->isNumber()) {
TessaAssert(loadedNativeValue->getType()->getTypeID() == 2);
}
// local[paramCount + 1] = realValue
llvm::GetElementPtrInst* addressCalculation = llvm::GetElementPtrInst::Create(paramLocation, createConstantInt(0), "", optionalBasicBlock);
new llvm::StoreInst(loadedNativeValue, addressCalculation, optionalBasicBlock);
llvm::Instruction* branchToMerge = llvm::BranchInst::Create(mergeBlock, optionalBasicBlock);
// Force the first tessa basic block to be the merge block
llvmBasicBlock = mergeBlock;
_tessaToLlvmBasicBlockMap->put(preOptionalBlock, llvmBasicBlock);
// Reload the real value of the parameter. It's either the default value or real value
llvm::Value* paramValue;
if (nativeType->isPointer()) {
paramValue = createLlvmLoadPtr(paramLocation, 0);
} else if (nativeType->isNumber()) {
paramValue = createLlvmLoadDouble(paramLocation, 0);
} else if (nativeType->isBoolean()) {
paramValue = createLlvmLoad(paramLocation, 0);
paramValue = castToNative(paramValue, _tessaTypeFactory->integerType(), _tessaTypeFactory->boolType());
} else {
paramValue = createLlvmLoad(paramLocation, 0);
}
putValue(parameter, paramValue);
}
void LlvmIRGenerator::initOptionalParameters(TessaVM::BasicBlock* firstBasicBlock) {
TessaAssert(firstBasicBlock->getBasicBlockId() == 0);
MethodSignaturep methodSignature = methodInfo->getMethodSignature();
List<TessaInstruction*, avmplus::LIST_GCObjects>* instructions = firstBasicBlock->getInstructions();
if (methodInfo->hasOptional()) {
int32_t optionalCount = methodSignature->optional_count();
int32_t requiredCount = methodSignature->param_count() - optionalCount;
TessaAssert(requiredCount == methodSignature->requiredParamCount());
checkPointerSizes();
int displacement = 0;
// <= because the 0th argument is the "this" parameter
for (int i = 0; i <= requiredCount; i++) {
TessaTypes::Type* tessaType = getTessaType(methodSignature->paramTraits(i));
if (tessaType == _tessaTypeFactory->numberType()) {
displacement += sizeof(double);
} else {
displacement += sizeof(int);
}
}
/***
* Assume function:
* function testFunction(firstParameter, otherParameter = default)
* Arguments are laid out like this:
* 0 1 2
* "this" firstParameter otherParameter
*
* Required count will be 1, optional count will be 1
* To actually get the default value, need to offset optionalCount + requiredCount which will get us to the optinal arguments
*/
for (int optionalIndex = 0; optionalIndex < optionalCount; optionalIndex++) {
int parameterIndex = optionalIndex + requiredCount + 1; // + 1. Optional starts at 0, but we need to get the param AFTER all the required parameters
TessaInstruction* parameter = instructions->get(parameterIndex);
TessaAssert(parameter->isParameter());
Atom defaultValue = methodSignature->getDefaultValue(optionalIndex); // MethodSignature auto corrects the index
buildJitTimeOptionalParameter(parameter, defaultValue, parameterIndex, optionalIndex, requiredCount, displacement, firstBasicBlock);
TessaTypes::Type* paramType = parameter->getType();
if (paramType->isNumber()) {
displacement += sizeof(double);
} else {
displacement += sizeof(int);
}
}
}
}
llvm::Argument* LlvmIRGenerator::getArgCountParameter() {
// Really need to find a better way to get the arguments
llvm::Function::arg_iterator argIter = _llvmFunction->arg_begin();
for (int i = 0; i < 1; i++) {
argIter++;
}
return argIter;
}
llvm::Argument* LlvmIRGenerator::getAtomArgumentsParameter() {
// Really need to find a better way to get the third argument :(. llvm->functionarg_end() already passes the arguments
llvm::Function::arg_iterator argIter = _llvmFunction->arg_begin();
for (int i = 0; i < 2; i++) {
argIter++;
}
return argIter;
}
/***
* We assume the method signature of a method call is invoke(MethodEnv* env, int argCount, Atom* arguments);
* However, Arguments isn't necessarily an array of Atoms. Everything should be unboxed and coerced
* to the appropriate declared types by the caller method.
*/
void LlvmIRGenerator::copyRequiredParameters(TessaVM::BasicBlock* firstBasicBlock) {
llvm::Argument* atomArguments = getAtomArgumentsParameter();
TessaAssert(atomArguments->getType()->isPointerTy());
checkPointerSizes();
MethodSignaturep methodSignature = methodInfo->getMethodSignature();
int requiredArgCount = methodSignature->requiredParamCount();
List<TessaInstruction*, avmplus::LIST_GCObjects>* instructions = firstBasicBlock->getInstructions();
int displacement = 0;
for (int i = 0; i <= requiredArgCount; i++) {
TessaInstruction* parameter = instructions->get(i);
TessaAssert(parameter->isParameter());
llvm::GetElementPtrInst* atomAddress = llvm::GetElementPtrInst::Create(atomArguments, createConstantInt(displacement / sizeof(int32_t)), "", llvmBasicBlock);
llvm::Value* llvmParameterValue;
if (parameter->isNumber()) {
/***
* We can pass number arguments in non-aligned sizes eg argsPointer[4] = someDouble. However, GEP won't let us address
* argsPointer[4] since the base address is based on a word size of 4.
* so manually increment the pointer to argPointer + 4. Set that value to a double pointer type, and load from offset 0. Ugly ugly ugly
*/
llvm::Value* doubleLocationPtr = doPointerArithmetic(atomArguments, displacement);
llvmParameterValue = createLlvmLoadDouble(doubleLocationPtr, 0);
displacement += sizeof(double);
} else {
llvm::Value* loadInstruction = new llvm::LoadInst(atomAddress, "", llvmBasicBlock);
llvmParameterValue = loadInstruction;
if (parameter->isPointer()) {
llvmParameterValue = castIntToPtr(llvmParameterValue);
} else if (parameter->isBoolean()) {
// We loaded an int32ty, have to cast to native llvm's int1ty
llvmParameterValue = castToNative(llvmParameterValue, _tessaTypeFactory->integerType(), _tessaTypeFactory->boolType());
}
displacement += sizeof(int32_t);
}
putValue(parameter, llvmParameterValue);
}
}
void LlvmIRGenerator::createRestParameters(TessaVM::BasicBlock* firstBasicBlock) {
MethodSignaturep methodSignature = methodInfo->getMethodSignature();
llvm::Argument* atomArguments = getAtomArgumentsParameter();
llvm::Argument* argCountArgument = getArgCountParameter();
List<TessaInstruction*, avmplus::LIST_GCObjects>* instructions = firstBasicBlock->getInstructions();
/**
* Fill out the "REST" arguments AFTER the normal parameter instructions
* Also, we have to explicitly remap some the REST parameter AFTER we put in the "real" passed in arguments
* Ask the semantics of the interpreter why this is
*/
if (methodInfo->needRest()) {
int parameterCount = methodSignature->param_count();
TessaInstruction* parameter = instructions->get(parameterCount + 1);
TessaAssert(parameter->isParameter());
llvm::Value* restParameters = createLlvmCallInstruction(GET_LLVM_CALLINFO(MethodEnvCreateRest), 3, _envPointer, atomArguments, argCountArgument);
TessaAssert(parameter->isArray());
restParameters = createBitCast(restParameters, _pointerType);
putValue(parameter, restParameters);
} else if (methodInfo->needArguments()) {
TessaAssert(false);
// create arguments using atomv[1..argc].
// Even tho E3 says create an Object, E4 says create an Array so thats what we will do.
//framep[param_count+1] = env->createArguments(_atomv, arguments_argc)->atom();
}
}
void LlvmIRGenerator::unboxParametersToNativeTypes(TessaVM::BasicBlock* firstBasicBlock) {
TessaAssert(false);
MethodSignaturep methodSignature = methodInfo->getMethodSignature();
List<ParameterInstruction*, LIST_GCObjects>* parameters = firstBasicBlock->getParameterInstructions();
for (int i = 0; i < methodSignature->param_count(); i++) {
TessaInstruction* tessaParam = parameters->get(i + 1); // + 1 since the 0th atom arg is the "this" param
llvm::Value* parameter = getValue(tessaParam);
parameter = atomToNative(parameter, tessaParam->getType());
putValue(tessaParam, parameter);
}
TessaInstruction* tessaParam = parameters->get(0); // Coerce the "this" object
llvm::Value* thisParameter= getValue(tessaParam);
thisParameter = atomToNative(thisParameter, tessaParam->getType());
putValue(tessaParam, thisParameter);
}
/***
* Argument data structures are kind of weird. Even if there is no explicit default value in AS source,
* the method signature assumes that the default value for a variable is undefined.
* Therefore, we have to initialize all arguments to undefined, THEN overwrite them
* with the real passed in values.
*/
void LlvmIRGenerator::setParametersToUndefined(TessaVM::BasicBlock* firstBasicBlock) {
TessaAssert(firstBasicBlock->getBasicBlockId() == 0);
List<ParameterInstruction*, LIST_GCObjects>* parameters = firstBasicBlock->getParameterInstructions();
for (uint32_t i = 0; i < parameters->size(); i++) {
putValue(parameters->get(i), _undefinedAtom);
}
}
void LlvmIRGenerator::mapParametersToValues(TessaVM::BasicBlock* firstBasicBlock) {
bool isSigned = false;
TessaAssert(firstBasicBlock->getBasicBlockId() == 0);
currentBasicBlock = firstBasicBlock;
TessaAssert(_llvmFunction->arg_size() == 3); // Method*, argc, Atom*
setParametersToUndefined(firstBasicBlock);
initOptionalParameters(firstBasicBlock);
copyRequiredParameters(firstBasicBlock);
createRestParameters(firstBasicBlock);
}
llvm::BasicBlock* LlvmIRGenerator::getLlvmBasicBlock(TessaVM::BasicBlock* tessaBasicBlock) {
llvm::BasicBlock* foundBasicBlock = _tessaToLlvmBasicBlockMap->get(tessaBasicBlock);
TessaAssert(foundBasicBlock!= NULL);
return foundBasicBlock;
}
void LlvmIRGenerator::createLlvmBasicBlocks(ASFunction* function) {
char basicBlockName[32];
List<TessaVM::BasicBlock*, avmplus::LIST_GCObjects> *basicBlocks = function->getBasicBlocksInReversePostOrder();
for (uint32_t basicBlockIndex = 0; basicBlockIndex < basicBlocks->size(); basicBlockIndex++) {
TessaVM::BasicBlock* tessaBasicBlock = basicBlocks->get(basicBlockIndex);
sprintf(basicBlockName, "BB%d", tessaBasicBlock->getBasicBlockId());
llvm::BasicBlock* newLlvmBasicBlock = llvm::BasicBlock::Create(*context, basicBlockName, _llvmFunction);
TessaAssert(newLlvmBasicBlock != NULL);
_tessaToLlvmBasicBlockMap->put(tessaBasicBlock, newLlvmBasicBlock);
}
}
void LlvmIRGenerator::visitBlocksInReversePostOrder(ASFunction* function) {
debugMessage("\n\n ======= Creating LLVM IR ========\n");
TessaVM::BasicBlock* rootBlock = function->getEntryBlock();
List<TessaVM::BasicBlock*, avmplus::LIST_GCObjects>* reversePostOrderList = function->getBasicBlocksInReversePostOrder();
for (uint32_t basicBlockIndex = 0; basicBlockIndex < reversePostOrderList->size(); basicBlockIndex++) {
currentBasicBlock = reversePostOrderList->get(basicBlockIndex);
#ifdef DEBUG
if (core->config.tessaVerbose) {
printf("Basic block: %d\n", currentBasicBlock->getBasicBlockId());
}
#endif
llvmBasicBlock = getLlvmBasicBlock(currentBasicBlock);
List<TessaInstruction*, avmplus::LIST_GCObjects>* instructions = currentBasicBlock->getInstructions();
for (uint32_t instructionIndex = 0; instructionIndex < instructions->size(); instructionIndex++) {
TessaInstruction* currentInstruction = instructions->get(instructionIndex);
#ifdef DEBUG
if (core->config.tessaVerbose) {
currentInstruction->print();
}
#endif
currentInstruction->visit(this);
}
/***
* We may create new basic blocks when we inline specialized cases during LLVM IR creation
* This maps the actual llvm END basic block. Thus a TESSA basic block may start at one llvm block
* and "end" at a different llvm basic block.
*/
this->_tessaToEndLlvmBasicBlockMap->put(currentBasicBlock, llvmBasicBlock);
}
}
void LlvmIRGenerator::createLIR(MethodInfo* methodInfo, ASFunction* function) {
this->methodInfo = methodInfo;
createLlvmBasicBlocks(function);
List<TessaVM::BasicBlock*, avmplus::LIST_GCObjects> *basicBlocks = function->getBasicBlocks();
llvmBasicBlock = getLlvmBasicBlock(function->getEntryBlock());
insertConstantAtoms(function);
_allocedArgumentsPointer = allocateArgumentsPointer(basicBlocks);
mapParametersToValues(function->getEntryBlock());
createPrologue(methodInfo);
visitBlocksInReversePostOrder(function);
addLlvmPhiValues(basicBlocks);
//createEpilogue(); Occurs right before the return
}
void LlvmIRGenerator::visit(TessaInstruction* tessaInstruction) {
TessaAssertMessage(false, "Should not create llvm ir for a generic tessa instruction");
}
llvm::Value* LlvmIRGenerator::emitFindDefinition(FindPropertyInstruction* findPropertyInstruction, llvm::Value* multinamePointer) {
if (findPropertyInstruction->useFindDefCache) {
int cacheSlot = findPropertyInstruction->getCacheSlot();
llvm::Value* scriptObjectCache = createLlvmCallInstruction(GET_LLVM_CALLINFO(finddef_cache), 3, _envPointer, multinamePointer, createConstantInt(cacheSlot));
return createBitCast(scriptObjectCache, _pointerType);
} else {
TessaAssert(false);
//return createLlvmCallInstruction(GET_LLVM_CALLINFO(finddef_slow), 2, envPointer, multinamePointer);
}
}
void LlvmIRGenerator::visit(FindPropertyInstruction* findPropertyInstruction) {
const Multiname* multiName = findPropertyInstruction->getMultiname();
llvm::Value* multinamePointer = castIntToPtr(createConstantInt((intptr_t)multiName));
llvm::Value* foundDefinition;
if (findPropertyInstruction->isFindDefinition()) {
foundDefinition = emitFindDefinition(findPropertyInstruction, multinamePointer);
} else {
/***
* Todo:
* Work in with scope, and the real scope object
* MethodEnvFindProp should return script object not Atom
*/
bool isStrict = findPropertyInstruction->isStrict();
llvm::Value* isStrictBoolean = createConstantBoolean(isStrict);
foundDefinition = createLlvmCallInstruction(GET_LLVM_CALLINFO(MethodEnvFindProperty), 3, _envPointer, multinamePointer, isStrictBoolean);
}
putValue(findPropertyInstruction, foundDefinition);
}
bool LlvmIRGenerator::hasType(TessaValue* tessaValue) {
return !tessaValue->getType()->isAnyType();
}
bool LlvmIRGenerator::isLlvmPointerType(TessaTypes::Type* tessaType) {
return tessaType->isPointer();
/*
switch (tessaType) {
case VECTOR:
case &_tessaTypeFactory->anyArrayType():
case &TessaTypes::objectVectorType:
case &TessaTypes::intVectorType:
case &TessaTypes::uintVectorType:
case &_tessaTypeFactory->numberVectorType():
case _tessaTypeFactory->scriptObjectType():
case _tessaTypeFactory->stringType():
return true;
default:
return false;
* */
}
bool LlvmIRGenerator::isLlvmIntegerType(TessaTypes::Type* tessaType) {
TessaAssert(false);
return false;
}
bool LlvmIRGenerator::isAtomType(llvm::Value* value) {
return value->getType() == _atomType;
}
bool LlvmIRGenerator::isPointerType(llvm::Value* value) {
return value->getType()->isPointerTy();
}
bool LlvmIRGenerator::isBoolType(llvm::Value* value) {
return value->getType() == _booleanType;
}
bool LlvmIRGenerator::isInteger(TessaValue* tessaValue) {
return tessaValue->getType()->isInteger();
}
bool LlvmIRGenerator::isVoidType(const llvm::Type* type) {
return type == llvm::Type::getVoidTy(*context);
}
void LlvmIRGenerator::visit(ConstantValueInstruction* constantValueInstruction) {
ConstantValue* constantValue = constantValueInstruction->getConstantValue();
llvm::Value* llvmConstantValue;
if (constantValue->isString()) {
ConstantString* constantString = (ConstantString*) constantValue;
Stringp stringValue = constantString->getValue();
llvmConstantValue = createConstantPtr((intptr_t)stringValue);
} else if (constantValue->isNull()) {
llvmConstantValue = _nullObjectAtom;
} else if (constantValue->isInteger()) {
TessaTypes::ConstantInt* tessaConstantInteger = (TessaTypes::ConstantInt*) constantValue;
llvmConstantValue = createConstantInt(tessaConstantInteger->getValue());
} else if (constantValue->isNumber()) {
ConstantFloat* constantDouble = (ConstantFloat*) constantValue;
llvmConstantValue = createConstantDouble(constantDouble->getValue());
} else if (constantValue->isUndefined()) {
llvmConstantValue = _undefinedAtom;
} else if (constantValue->isBoolean()) {
ConstantBool* constantBool = (ConstantBool*) constantValue;
if (constantBool->getValue()) {
llvmConstantValue = createConstantBoolean(true);
} else {
llvmConstantValue = createConstantBoolean(false);
}
} else {
TessaAssert(false);
}
putValue(constantValueInstruction, llvmConstantValue);
}
void LlvmIRGenerator::visit(ReturnInstruction* returnInstruction) {
llvm::Value* returnValue;
if (returnInstruction->getIsVoidReturn()) {
returnValue = _undefinedAtom;
} else {
TessaInstruction* tessaReturnValue = returnInstruction->getValueToReturn();
returnValue = castToNative(getValue(tessaReturnValue), tessaReturnValue->getType(), returnInstruction->getType());
if (tessaReturnValue->isBoolean() && (returnInstruction->getType()->isBoolean())) {
/**
* Have to cast it to a full 32 bit integer because the rest of the VM expects it
*/
returnValue = castBooleanToNative(returnValue, _tessaTypeFactory->integerType());
}
}
TessaAssert(returnValue != NULL);
_returnCount++;
TessaAssertMessage(_returnCount == 1, "Should only have one return instruction");
createEpilogue();
llvm::Value* llvmReturnInst = ReturnInst::Create(*context, returnValue, llvmBasicBlock);
putValue(returnInstruction, llvmReturnInst);
}
llvm::Value* LlvmIRGenerator::compileBitwiseBinaryOp(TessaInstructions::TessaBinaryOp opcode, llvm::Value* leftInteger, llvm::Value* rightInteger) {
TessaAssert(leftInteger->getType() == _intType);
TessaAssert(rightInteger->getType() == _intType);
llvm::Instruction* resultInteger;
switch (opcode) {
case BITWISE_LSH:
resultInteger = llvm::BinaryOperator::Create(llvm::Instruction::Shl, leftInteger, rightInteger, "", llvmBasicBlock);
break;
case BITWISE_RSH:
resultInteger = llvm::BinaryOperator::Create(llvm::Instruction::AShr, leftInteger, rightInteger, "", llvmBasicBlock);
break;
case BITWISE_AND:
resultInteger = llvm::BinaryOperator::Create(llvm::Instruction::And, leftInteger, rightInteger, "", llvmBasicBlock);
break;
case BITWISE_OR:
resultInteger = llvm::BinaryOperator::Create(llvm::Instruction::Or, leftInteger, rightInteger, "", llvmBasicBlock);
break;
case BITWISE_XOR:
resultInteger = llvm::BinaryOperator::Create(llvm::Instruction::Xor, leftInteger, rightInteger, "", llvmBasicBlock);
break;
default:
TessaAssertMessage(false, "Unknown bitwise operation");
break;
}
return resultInteger;
}
/***
* Assumes values are already integers
*/
llvm::Value* LlvmIRGenerator::compileIntegerBinaryOp(TessaInstructions::TessaBinaryOp binaryOp, llvm::Value* leftIntegerValue, llvm::Value* rightIntegerValue) {
TessaAssert(leftIntegerValue->getType() == _intType);
TessaAssert(rightIntegerValue->getType() == _intType);
llvm::Instruction* resultInteger;
switch (binaryOp) {
case ADD:
TessaAssert(false);
break;
case SUBTRACT:
resultInteger = llvm::BinaryOperator::Create(llvm::Instruction::Sub, leftIntegerValue, rightIntegerValue, "", llvmBasicBlock);
break;
case MULTIPLY:
resultInteger = llvm::BinaryOperator::Create(llvm::Instruction::Mul, leftIntegerValue, rightIntegerValue, "", llvmBasicBlock);
break;
default:
TessaAssertMessage(false, "Unknown integer binary instruction");
break;
}
TessaAssert(resultInteger!= NULL);
return resultInteger;
}
/***
* This assumes that the values are already unboxed in native form
*/
llvm::Value* LlvmIRGenerator::compileDoubleBinaryOp(TessaInstructions::TessaBinaryOp binaryOp, llvm::Value* leftDoubleValue, llvm::Value* rightDoubleValue) {
TessaAssert(leftDoubleValue->getType() == _doubleType);
TessaAssert(rightDoubleValue->getType() == _doubleType);
llvm::Instruction* resultDouble;
switch (binaryOp) {
case SUBTRACT:
resultDouble = llvm::BinaryOperator::Create(llvm::Instruction::FSub, leftDoubleValue, rightDoubleValue, "", llvmBasicBlock);
break;
case MULTIPLY:
resultDouble = llvm::BinaryOperator::Create(llvm::Instruction::FMul, leftDoubleValue, rightDoubleValue, "", llvmBasicBlock);
break;
case DIVIDE:
resultDouble = llvm::BinaryOperator::Create(llvm::Instruction::FDiv, leftDoubleValue, rightDoubleValue, "", llvmBasicBlock);
break;
case MOD:
resultDouble = createLlvmCallInstruction(GET_LLVM_CALLINFO(MathUtilsMod), 2, leftDoubleValue, rightDoubleValue);
break;
default:
TessaAssertMessage(false, "Unknown double binary instruction");
break;
}
TessaAssert(resultDouble != NULL);
return resultDouble;
}
llvm::Value* LlvmIRGenerator::compileUnsignedRightShift(TessaBinaryOp binaryOp, llvm::Value* uintLeft, llvm::Value* uintRight) {
TessaAssert(binaryOp == BITWISE_URSH);
// Create ( (uint32_t)(u1 >> (u2 & 0x1F)) );
TessaAssert(uintLeft->getType() == _uintType);
llvm::Value* andedValue = llvm::BinaryOperator::Create(Instruction::And, uintRight, createConstantInt(0x1F), "", llvmBasicBlock);
return llvm::BinaryOperator::Create(Instruction::LShr, uintLeft, andedValue, "", llvmBasicBlock);
}
llvm::Value* LlvmIRGenerator::compileTypedBinaryOperation(TessaInstructions::BinaryInstruction* binaryInstruction) {
TessaValue* leftInstruction = binaryInstruction->getLeftOperand();
TessaValue* rightInstruction = binaryInstruction->getRightOperand();
TessaTypes::Type* resultType = binaryInstruction->getType();
TessaTypes::Type* leftType = leftInstruction->getType();
TessaTypes::Type* rightType = rightInstruction->getType();
llvm::Value* leftOperand = getValue(leftInstruction);
llvm::Value* rightOperand = getValue(rightInstruction);
TessaInstructions::TessaBinaryOp binaryOp = binaryInstruction->getOpcode();
TessaAssert(hasType(leftInstruction) || hasType(rightInstruction));
llvm::Value* llvmBinaryInstruction;
switch (binaryOp) {
case ADD:
{
TessaTypes::Type* resultType = binaryInstruction->getType();
if (resultType->isNumber()) {
leftOperand = castToNative(leftOperand, leftType, _tessaTypeFactory->numberType());
rightOperand = castToNative(rightOperand, rightType, _tessaTypeFactory->numberType());
llvmBinaryInstruction = llvm::BinaryOperator::Create(llvm::Instruction::FAdd, leftOperand, rightOperand, "", llvmBasicBlock);
} else if (resultType->isString()) {
leftOperand = castToNative(leftOperand, leftType, _tessaTypeFactory->stringType());
rightOperand = castToNative(rightOperand, rightType, _tessaTypeFactory->stringType());
llvmBinaryInstruction = createLlvmCallInstruction(GET_LLVM_CALLINFO(StringConcatStrings), 2, leftOperand, rightOperand);
llvmBinaryInstruction = createBitCast(llvmBinaryInstruction, _pointerType);
} else if (resultType == _tessaTypeFactory->integerType()) {
leftOperand = castToNative(leftOperand, leftType, _tessaTypeFactory->integerType());
rightOperand = castToNative(rightOperand, rightType, _tessaTypeFactory->integerType());
llvmBinaryInstruction = llvm::BinaryOperator::Create(llvm::Instruction::Add, leftOperand, rightOperand, "", llvmBasicBlock);
} else {
TessaAssert(resultType->isObject());
leftOperand = nativeToAtom(leftOperand, leftType);
rightOperand = nativeToAtom(rightOperand, rightType);
llvmBinaryInstruction = createLlvmCallInstruction(GET_LLVM_CALLINFO(op_add), 3, _avmcorePointer, leftOperand, rightOperand);
}
break;
}
case BITWISE_URSH:
{
leftOperand = castToNative(leftOperand, leftType, _tessaTypeFactory->uintType());
rightOperand = castToNative(rightOperand, rightType, _tessaTypeFactory->uintType());
llvmBinaryInstruction = compileUnsignedRightShift(binaryOp, leftOperand, rightOperand);
break;
}
case BITWISE_LSH:
case BITWISE_RSH:
case BITWISE_OR:
case BITWISE_XOR:
case BITWISE_AND:
{
leftOperand = castToNative(leftOperand, leftType, _tessaTypeFactory->integerType());
rightOperand = castToNative(rightOperand, rightType, _tessaTypeFactory->integerType());
llvmBinaryInstruction = compileBitwiseBinaryOp(binaryOp, leftOperand, rightOperand);
break;
}
case SUBTRACT:
case MULTIPLY:
case DIVIDE:
case MOD:
{
if (leftType->isInteger() && (rightType->isInteger()) && (resultType->isInteger())) {
llvmBinaryInstruction = compileIntegerBinaryOp(binaryOp, leftOperand, rightOperand);
} else {
leftOperand = castToNative(leftOperand, leftType, _tessaTypeFactory->numberType());
rightOperand = castToNative(rightOperand, rightType, _tessaTypeFactory->numberType());
llvmBinaryInstruction = compileDoubleBinaryOp(binaryOp, leftOperand, rightOperand);
llvmBinaryInstruction = castToNative(llvmBinaryInstruction, _tessaTypeFactory->numberType(), binaryInstruction->getType());
}
break;
}
default:
{
TessaAssertMessage(false, "Unknown binary operand");
break;
}
}
return llvmBinaryInstruction;
}
llvm::Value* LlvmIRGenerator::compileAtomBinaryOperation(TessaInstructions::BinaryInstruction* binaryInstruction) {
TessaValue* leftValue = binaryInstruction->getLeftOperand();
TessaValue* rightValue = binaryInstruction->getRightOperand();
TessaTypes::Type* leftType = leftValue->getType();
TessaTypes::Type* rightType = rightValue->getType();
llvm::Value* leftOperand = getValue(leftValue);
llvm::Value* rightOperand = getValue(rightValue);
leftOperand = nativeToAtom(leftOperand, leftType);
rightOperand = nativeToAtom(rightOperand, rightType);
TessaInstructions::TessaBinaryOp binaryOp = binaryInstruction->getOpcode();
TessaAssert(!hasType(binaryInstruction->getLeftOperand()) || !hasType(binaryInstruction->getRightOperand()));
llvm::Value* llvmBinaryInstruction;
switch (binaryOp) {
case ADD:
{
llvmBinaryInstruction = createLlvmCallInstruction(GET_LLVM_CALLINFO(op_add), 3, _avmcorePointer, leftOperand, rightOperand);
llvmBinaryInstruction = atomToNative(llvmBinaryInstruction, binaryInstruction->getType());
break;
}
case BITWISE_URSH:
{
llvmBinaryInstruction = compileUnsignedRightShift(binaryOp, leftOperand, rightOperand);
break;
}
case BITWISE_LSH:
case BITWISE_RSH:
case BITWISE_OR:
case BITWISE_XOR:
case BITWISE_AND:
{
leftOperand = atomToNative(leftOperand, _tessaTypeFactory->integerType());
rightOperand = atomToNative(rightOperand, _tessaTypeFactory->integerType());
llvmBinaryInstruction = compileBitwiseBinaryOp(binaryOp, leftOperand, rightOperand);
break;
}
case SUBTRACT:
case MULTIPLY:
case DIVIDE:
case MOD:
{
leftOperand = atomToNative(leftOperand, _tessaTypeFactory->numberType());
rightOperand = atomToNative(rightOperand, _tessaTypeFactory->numberType());
llvmBinaryInstruction = compileDoubleBinaryOp(binaryOp, leftOperand, rightOperand);
break;
}
default:
{
TessaAssertMessage(false, "Unknown binary operand");
break;
}
}
return llvmBinaryInstruction;
}
void LlvmIRGenerator::visit(BinaryInstruction* binaryInstruction) {
TessaValue* leftOp = binaryInstruction->getLeftOperand();
TessaValue* rightOp = binaryInstruction->getRightOperand();
llvm::Value* llvmBinaryInstruction;
if (hasType(leftOp) && hasType(rightOp)) {
llvmBinaryInstruction = compileTypedBinaryOperation(binaryInstruction);
} else {
llvmBinaryInstruction = compileAtomBinaryOperation(binaryInstruction);
}
TessaAssert(llvmBinaryInstruction != NULL);
putValue(binaryInstruction, llvmBinaryInstruction);
}
/***
* Avm2 spec for IFNGT, IFNLE, IFNGE, IFNLT say must branch even if a condition uses NaN
**/
bool LlvmIRGenerator::requiresNaNCheck(TessaBinaryOp opcode) {
switch (opcode) {
case NOT_GREATER_THAN:
case NOT_GREATER_EQUAL_THAN:
case NOT_LESS_THAN:
case NOT_LESS_EQUAL_THAN:
return true;
default:
return false;
}
}
llvm::Instruction* LlvmIRGenerator::checkForNaNLlvm(llvm::Value* compareResult , llvm::Value* leftValue, llvm::Value* rightValue) {
AvmAssert(leftValue->getType()->isDoubleTy());
AvmAssert(rightValue->getType()->isDoubleTy());
llvm::Value* isNaN = new llvm::FCmpInst(*llvmBasicBlock, llvm::CmpInst::FCMP_UNO, leftValue, rightValue);
/***
* We got here because we were comparing a floating point value versus 0.
* If the value is NaN, we need to return true.
* If the value is NOT NaN, return the original comparison against 0
*/
return llvm::SelectInst::Create(isNaN, createConstantBoolean(true), compareResult, "NaN Select", llvmBasicBlock);
}
llvm::Instruction* LlvmIRGenerator::checkForNaNAtomLlvm(TessaBinaryOp conditionOpcode, llvm::Value* compareResult) {
AvmAssert(isAtomType(compareResult));
// NaN is defined as the undefined atom when boxed
llvm::Value* isNaN = new llvm::ICmpInst(*llvmBasicBlock, llvm::CmpInst::ICMP_EQ, compareResult, _undefinedAtom);
llvm::Value* returnAtom = _falseAtom;
if (requiresNaNCheck(conditionOpcode)) {
returnAtom = _trueAtom;
}
return llvm::SelectInst::Create(isNaN, returnAtom, compareResult, "Atom NaN select", llvmBasicBlock);
}
llvm::Value* LlvmIRGenerator::compileTypedCondition(TessaInstructions::ConditionInstruction* conditionInstruction) {
TessaValue* leftOperand = conditionInstruction->getLeftOperand();
TessaValue* rightOperand = conditionInstruction->getRightOperand();
TessaAssert(hasType(leftOperand) && hasType(rightOperand));
llvm::Instruction* result;
TessaTypes::Type* leftType = leftOperand->getType();
TessaTypes::Type* rightType = rightOperand->getType();
llvm::Value* leftValue = getValue(conditionInstruction->getLeftOperand());
llvm::Value* rightValue = getValue(conditionInstruction->getRightOperand());
TessaBinaryOp conditionOpcode = conditionInstruction->getOpcode();
bool useInt = true;
bool useBoolean = false;
if ((isInteger(leftOperand) && isInteger(rightOperand)) ||
(leftOperand->isUnsignedInteger() && rightOperand->isUnsignedInteger())) {
useInt = true;
} else if (isInteger(leftOperand) && rightOperand->isNumber()) {
useInt = false;
leftValue = castToNative(leftValue, _tessaTypeFactory->integerType(), _tessaTypeFactory->numberType());
} else if (isInteger(rightOperand) && leftOperand->isNumber()) {
useInt = false;
rightValue = castToNative(rightValue, _tessaTypeFactory->integerType(), _tessaTypeFactory->numberType());
} else if (leftOperand->isBoolean() || rightOperand->isBoolean()) {
useInt = true;
useBoolean = true;
leftValue = castToNative(leftValue, leftType, _tessaTypeFactory->boolType());
rightValue = castToNative(rightValue, rightType, _tessaTypeFactory->boolType());
} else if ((leftOperand->isUnsignedInteger() && !rightOperand->isUnsignedInteger()) ||
(rightOperand->isUnsignedInteger() && !leftOperand->isUnsignedInteger())) {
AvmAssert(leftOperand->isNumeric());
AvmAssert(rightOperand->isNumeric());
useInt = false;
leftValue = castToNative(leftValue, leftType, _tessaTypeFactory->numberType());
rightValue = castToNative(rightValue, rightType, _tessaTypeFactory->numberType());
} else {
TessaAssert(leftOperand->isNumber() && rightOperand->isNumber());
useInt = false;
}
bool useFloat = !useInt;
llvm::ICmpInst::Predicate integerOpcode;
llvm::FCmpInst::Predicate floatOpcode;
/****
* Core->compare() returns true if less than.
*/
switch (conditionOpcode) {
case NOT_EQUAL:
{
if (useInt) {
integerOpcode = ICmpInst::ICMP_NE;
} else {
floatOpcode = CmpInst::FCMP_ONE;
}
break;
}
case EQUAL:
{
if (useInt) {
integerOpcode = ICmpInst::ICMP_EQ;
} else {
floatOpcode = CmpInst::FCMP_OEQ;
}
break;
}
case IFFALSE:
case IFTRUE:
{
TessaAssert(useBoolean);
TessaAssert(isBoolType(leftValue));
integerOpcode = ICmpInst::ICMP_EQ;
break;
}
case LESS_THAN:
case NOT_GREATER_EQUAL_THAN:
{
if (useInt) {
integerOpcode = ICmpInst::ICMP_SLT;
} else {
floatOpcode = CmpInst::FCMP_OLT;
}
break;
}
case GREATER_EQUAL_THAN:
case NOT_LESS_THAN:
{
if (useInt) {
integerOpcode = ICmpInst::ICMP_SGE;
} else {
floatOpcode = CmpInst::FCMP_OGE;
}
break;
}
// !(a > b) === !(b<a)
case NOT_GREATER_THAN:
case LESS_EQUAL_THAN:
{
if (useInt) {
integerOpcode = ICmpInst::ICMP_SLE;
} else {
floatOpcode = CmpInst::FCMP_OLE;
}
break;
}
// a > b === b < a
case NOT_LESS_EQUAL_THAN:
case GREATER_THAN:
{
if (useInt) {
integerOpcode = ICmpInst::ICMP_SGT;
} else {
floatOpcode = CmpInst::FCMP_OGT;
}
break;
}
case STRICT_NOT_EQUAL:
{
TessaTypes::Type* leftType = leftOperand->getType();
TessaTypes::Type* rightType = rightOperand->getType();
if (leftType != rightType) {
return (llvm::Instruction*) createConstantBoolean(false);
}
if (useInt) {
integerOpcode = ICmpInst::ICMP_NE;
} else {
floatOpcode = CmpInst::FCMP_ONE;
}
break;
}
case STRICT_EQUAL:
{
TessaTypes::Type* leftType = leftOperand->getType();
TessaTypes::Type* rightType = rightOperand->getType();
if (leftType != rightType) {
return (llvm::Instruction*) createConstantBoolean(false);
}
if (useInt) {
integerOpcode = ICmpInst::ICMP_EQ;
} else {
floatOpcode = CmpInst::FCMP_OEQ;
}
break;
}
default:
{
TessaAssert(false);
break;
}
}
if (useInt) {
result = new llvm::ICmpInst(*llvmBasicBlock, integerOpcode, leftValue, rightValue);
} else {
result = new llvm::FCmpInst(*llvmBasicBlock, floatOpcode, leftValue, rightValue);
if (requiresNaNCheck(conditionOpcode)) {
result = checkForNaNLlvm(result, leftValue, rightValue);
}
}
TessaAssert(result != NULL);
return result;
}
llvm::Value* LlvmIRGenerator::compileAtomCondition(TessaInstructions::ConditionInstruction* conditionInstruction) {
TessaValue* tessaLeftOperand = conditionInstruction->getLeftOperand();
TessaValue* tessaRightOperand = conditionInstruction->getRightOperand();
llvm::Value* leftValue = nativeToAtom(getValue(tessaLeftOperand), tessaLeftOperand->getType());
llvm::Value* rightValue = nativeToAtom(getValue(tessaRightOperand), tessaRightOperand->getType());
TessaBinaryOp conditionOpcode = conditionInstruction->getOpcode();
llvm::Value* compareResult;
llvm::Value* result;
/****
* Core->compare() returns true if less than.
*/
switch (conditionOpcode) {
case NOT_EQUAL:
case EQUAL:
case IFFALSE:
case IFTRUE:
{
result = createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreEquals), 3, _avmcorePointer, leftValue, rightValue);
break;
}
case NOT_GREATER_EQUAL_THAN:
case LESS_THAN:
case GREATER_EQUAL_THAN:
case NOT_LESS_THAN:
{
result = createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreCompare), 3, _avmcorePointer, leftValue, rightValue);
break;
}
// !(a > b) === !(b<a)
case NOT_GREATER_THAN:
case LESS_EQUAL_THAN:
// a > b === b < a
case NOT_LESS_EQUAL_THAN:
case GREATER_THAN:
{
result = createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreCompare), 3, _avmcorePointer, rightValue, leftValue);
break;
}
case STRICT_NOT_EQUAL:
case STRICT_EQUAL:
{
result = createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreStrictEquals), 3, _avmcorePointer, leftValue, rightValue);
break;
}
default:
{
TessaAssert(false);
break;
}
}
compareResult = result;
switch (conditionOpcode) {
case NOT_EQUAL:
case GREATER_EQUAL_THAN:
case NOT_LESS_THAN:
case STRICT_NOT_EQUAL:
{
/* inverse the boolean result
* compare ^8 <8
* true 1101 0101 y
* false 0101 1101 n
* undefined 0100 1100 n
*/
result = llvm::BinaryOperator::Create(Instruction::Xor, result, createConstantInt(8), "ConditionFlipResult", llvmBasicBlock);
break;
}
case NOT_GREATER_THAN:
case LESS_EQUAL_THAN:
{
// Test for (a<=b) and jf for !(a<=b)
// compare ^1 <=4
// true 1101 1100 n
// false 0101 0100 y
// undefined 0100 0101 n
llvm::Value* xorValue = llvm::BinaryOperator::Create(Instruction::Xor, result, createConstantInt(1), "LEQXor", llvmBasicBlock);
llvm::Value* lessThan = new ICmpInst(*llvmBasicBlock, ICmpInst::ICMP_SLE, xorValue, createConstantInt(4), "LEQXorLEQ4");
result = llvm::SelectInst::Create(lessThan, _trueAtom, _falseAtom, "LEQ Select", llvmBasicBlock);
break;
}
case NOT_LESS_EQUAL_THAN:
case GREATER_THAN:
{
// Test for (a<=b) and jf for !(a<=b)
// compare ^1 <=4
// true 1101 1100 n
// false 0101 0100 y
// undefined 0100 0101 n
llvm::Value* xorValue = llvm::BinaryOperator::Create(Instruction::Xor, result, createConstantInt(1), "LEQXor", llvmBasicBlock);
llvm::Value* lessThan = new ICmpInst(*llvmBasicBlock, ICmpInst::ICMP_SLE, xorValue, createConstantInt(4), "LEQXorLEQ4");
result = llvm::SelectInst::Create(lessThan, _falseAtom, _trueAtom, "LEQ Select", llvmBasicBlock);
break;
}
default:
break;
}
return (llvm::Instruction*) atomToNative(result, _tessaTypeFactory->boolType());
}
llvm::Value* LlvmIRGenerator::compileConditionNullCheck(TessaBinaryOp opcode, TessaValue* leftOperand, TessaValue* rightOperand) {
llvm::Value* leftValue = getValue(leftOperand);
llvm::Value* rightValue = getValue(rightOperand);
leftValue = castToNative(leftValue, leftOperand->getType(), _tessaTypeFactory->integerType());
rightValue = castToNative(rightValue, rightOperand->getType(), _tessaTypeFactory->integerType());
llvm::ICmpInst::Predicate integerOpcode;
switch (opcode) {
case EQUAL:
integerOpcode = ICmpInst::ICMP_EQ;
break;
case NOT_EQUAL:
integerOpcode = ICmpInst::ICMP_NE;
break;
default:
TessaAssert(false);
}
return new llvm::ICmpInst(*llvmBasicBlock, integerOpcode, leftValue, rightValue);
}
llvm::Value* LlvmIRGenerator::compareAbsolutePointerAddresses(ConditionInstruction* conditionInstruction, llvm::Value* leftOperand, llvm::Value* rightOperand) {
llvm::Value* result = NULL;
switch (conditionInstruction->getOpcode()) {
case EQUAL:
result = new llvm::ICmpInst(*llvmBasicBlock, ICmpInst::ICMP_EQ, leftOperand, rightOperand);
break;
case NOT_EQUAL:
//AvmAssert(false);
result = new llvm::ICmpInst(*llvmBasicBlock, ICmpInst::ICMP_NE, leftOperand, rightOperand);
break;
default:
AvmAssert(false);
}
AvmAssert(result != NULL);
return result;
}
llvm::Value* LlvmIRGenerator::compilePointerCompare(ConditionInstruction* conditionInstruction) {
TessaValue* leftTessaValue = conditionInstruction->getLeftOperand();
TessaValue* rightTessaValue = conditionInstruction->getRightOperand();
llvm::Value* leftOperand = getValue(leftTessaValue);
llvm::Value* rightOperand = getValue(rightTessaValue);
TessaAssert(leftOperand->getType()->isPointerTy());
TessaAssert(rightOperand->getType()->isPointerTy());
llvm::Value* result;
if (leftTessaValue->getType()->isString() && rightTessaValue->getType()->isString()) {
// String compares have to be done via atoms :(
result = compileAtomCondition(conditionInstruction);
} else {
result = compareAbsolutePointerAddresses(conditionInstruction, leftOperand, rightOperand);
}
AvmAssert(result != NULL);
return result;
}
void LlvmIRGenerator::visit(ConditionInstruction* conditionInstruction) {
TessaValue* leftOperand = conditionInstruction->getLeftOperand();
TessaValue* rightOperand = conditionInstruction->getRightOperand();
llvm::Value* result;
if (conditionInstruction->forceOptimizeNullPointerCheck) {
result = compileConditionNullCheck(conditionInstruction->getOpcode(), leftOperand, rightOperand);
} else if ( (leftOperand->isNumeric() || leftOperand->isBoolean()) && (rightOperand->isNumeric() || rightOperand->isBoolean()) ) {
result = compileTypedCondition(conditionInstruction);
} else if (leftOperand->isPointer() && rightOperand->isPointer()) {
result = compilePointerCompare(conditionInstruction);
} else {
result = compileAtomCondition(conditionInstruction);
}
/*
if (conditionInstruction->forceOptimizeNullPointerCheck) {
result = compileConditionNullCheck(conditionInstruction->getOpcode(), leftOperand, rightOperand);
} else if ((leftOperand->isNumber() || isInteger(leftOperand) || leftOperand->isBoolean()) &&
(rightOperand->isNumber() || isInteger(rightOperand) || rightOperand->isBoolean())) {
result = compileTypedCondition(conditionInstruction);
} else if (leftOperand->isPointer() && rightOperand->isPointer()) {
result = compilePointerCompare(conditionInstruction);
} else {
result = compileAtomCondition(conditionInstruction);
}
*/
TessaAssert(result != NULL);
putValue(conditionInstruction, result);
}
llvm::Value* LlvmIRGenerator::compileTypedUnaryOperation(TessaInstructions::UnaryInstruction* unaryInstruction) {
llvm::Value* result;
llvm::Value* operand = getValue(unaryInstruction->getOperand());
TessaTypes::Type* operandType = unaryInstruction->getOperand()->getType();
switch (unaryInstruction->getOpcode()) {
case BITWISE_NOT:
{
operand = castToNative(operand, operandType, _tessaTypeFactory->integerType());
result = llvm::BinaryOperator::Create(Instruction::Xor, createConstantInt(0xFFFFFFFF), operand, "UnaryBitwiseNot", llvmBasicBlock);
break;
}
case NEGATE:
{
operand = castToNative(operand, operandType, _tessaTypeFactory->numberType());
result = llvm::BinaryOperator::Create(Instruction::FSub, createConstantDouble(0), operand, "UnaryNegate", llvmBasicBlock);
break;
}
case NOT:
{
operand = castToNative(operand, operandType, _tessaTypeFactory->boolType());
result = llvm::SelectInst::Create(operand, createConstantBoolean(false), createConstantBoolean(true), "", llvmBasicBlock);
break;
}
default:
TessaAssert(false);
}
return (llvm::Instruction*) result;
}
llvm::Value* LlvmIRGenerator::compileAtomUnaryOperation(TessaInstructions::UnaryInstruction* unaryInstruction) {
TessaInstruction* tessaOperand = unaryInstruction->getOperand();
llvm::Value* operand = nativeToAtom(getValue(unaryInstruction->getOperand()), tessaOperand->getType());
llvm::Value* result;
switch (unaryInstruction->getOpcode()) {
case BITWISE_NOT:
{
operand = atomToNative(operand, _tessaTypeFactory->integerType());
// Implement C ~ operator as (value ^ 0xFFFFFFFF)
result = llvm::BinaryOperator::Create(Instruction::Xor, createConstantInt(0xFFFFFFFF), operand, "UnaryBitwiseNot", llvmBasicBlock);
break;
}
case NEGATE:
{
operand = atomToNative(operand, _tessaTypeFactory->numberType());
result = llvm::BinaryOperator::Create(Instruction::Sub, createConstantDouble(0), operand, "UnaryNegate", llvmBasicBlock);
break;
}
case NOT:
{
result = createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreBooleanAtom), 1, operand);
llvm::Value* xorTrueFalse = llvm::BinaryOperator::Create(Instruction::Xor, _trueAtom, _falseAtom, "", llvmBasicBlock);
result = llvm::BinaryOperator::Create(Instruction::Xor, result, xorTrueFalse, "UnaryNot", llvmBasicBlock);
result = atomToNative(result, _tessaTypeFactory->boolType());
break;
}
default:
TessaAssert(false);
}
TessaAssert(result != NULL);
return (llvm::Instruction*) result;
}
void LlvmIRGenerator::visit(TessaInstructions::UnaryInstruction* unaryInstruction) {
TessaInstruction* tessaOperand = unaryInstruction->getOperand();
TessaTypes::Type* operandType = tessaOperand->getType();
llvm::Value* result;
if (!operandType->isAnyType()) {
result = compileTypedUnaryOperation(unaryInstruction);
} else {
result = compileAtomUnaryOperation(unaryInstruction);
}
TessaAssert(result != NULL);
putValue(unaryInstruction, result);
}
/***
* Allocates space on the stack and puts the instructions in the array of instructions
* in a contigous memory space
*/
void LlvmIRGenerator::visit(ArrayOfInstructions* arrayOfInstructions) {
}
void LlvmIRGenerator::visit(NewObjectInstruction* newObjectInstruction) {
llvm::Value* objectPropertyPairs = createAtomArgumentsPointer(newObjectInstruction->getObjectProperties());
int numberOfProperties = newObjectInstruction->getNumberOfProperties();
llvm::Value* newObjectScriptObject = createLlvmCallInstruction(GET_LLVM_CALLINFO(MethodEnvNewObject), 3, _envPointer, objectPropertyPairs, createConstantInt(numberOfProperties));
putValue(newObjectInstruction, newObjectScriptObject);
}
void LlvmIRGenerator::visit(ConstructInstruction* constructInstruction) {
TessaInstruction* receiverObject = constructInstruction->getReceiverObject();
llvm::Value* llvmReceiverObject = getValue(receiverObject);
llvm::Value* constructedObject;
if (constructInstruction->isEarlyBound()) {
TessaAssert(receiverObject->isScriptObject());
constructedObject = callEarlyBoundConstruct(constructInstruction);
constructedObject = ScriptObjectToAtom(constructedObject);
} else {
if (receiverObject->isScriptObject()) {
llvmReceiverObject = ScriptObjectToAtom(llvmReceiverObject);
} else {
TessaAssert(receiverObject->isAny());
}
llvm::Value* arguments = createAtomArgumentsPointer(constructInstruction->getArguments());
int argCount = constructInstruction->getNumberOfArgs();
constructedObject = createLlvmCallInstruction(GET_LLVM_CALLINFO(op_construct), 4, _toplevelPointer, llvmReceiverObject, createConstantInt(argCount), arguments);
}
// Constructed objects have to be atoms
TessaAssert(constructedObject->getType()->isIntegerTy());
putValue(constructInstruction, constructedObject);
}
llvm::Value* LlvmIRGenerator::callLateBoundConstructProperty(ConstructPropertyInstruction* constructPropertyInstruction) {
TessaAssert(!constructPropertyInstruction->isEarlyBound());
const Multiname* propertyMultiname = constructPropertyInstruction->getPropertyMultiname();
llvm::Value* propertyMultinamePointer = this->createConstantPtr((intptr_t)(propertyMultiname));
ArrayOfInstructions* callArguments = constructPropertyInstruction->getArguments();
int argCount = callArguments->size();
TessaAssert(argCount >= 1);
if (propertyMultiname->isRuntime()) {
TessaAssertMessage(false, "Don't know how to handle runtime multinames");
}
llvm::Value* receiverObject = getValue(callArguments->getInstruction(0));
llvm::Value* llvmArguments = createAtomArgumentsPointer(callArguments);
// constructprop expects the arg count to NOT include the "this" pointer
llvm::Value* constructedProperty = createLlvmCallInstruction(GET_LLVM_CALLINFO(constructprop), 4, _envPointer, propertyMultinamePointer, createConstantInt(argCount - 1), llvmArguments);
constructedProperty = atomToNative(constructedProperty, constructPropertyInstruction->getType());
TessaAssert(constructedProperty != NULL);
return constructedProperty;
}
/***
* Do this
* ScriptObject* ctor = AvmCore::atomToScriptObject(obj)->getSlotObject(AvmCore::bindingToSlotId(b));
*/
llvm::Value* LlvmIRGenerator::loadFromSlot(llvm::Value* receiverObject, TessaTypes::Type* tessaType, int slotNumber, Traits* objectTraits) {
const TraitsBindingsp traitsBinding = objectTraits->getTraitsBindings();
int offset = traitsBinding->getSlotOffset(slotNumber);
TessaAssert(receiverObject->getType()->isPointerTy());
TessaAssert(tessaType == _tessaTypeFactory->scriptObjectType());
// Load from receiverObject + address
llvm::Value* receiverObjectInt = castPtrToInt(receiverObject);
llvm::Value* receiverObjectAddress = castIntToPtr(llvm::BinaryOperator::Create(llvm::BinaryOperator::Add, receiverObjectInt, createConstantInt(offset), "", llvmBasicBlock));
return createLlvmLoadPtr(receiverObjectAddress, 0);
}
/***
* Do this:
*
* this == ClassClosure
* Vtable vtable = this->vtable();
* VTable* ivtable = vtable->ivtable
* ScriptObject* obj = newInstance();
* return obj
*/
llvm::Value* LlvmIRGenerator::emitCallToNewInstance(llvm::Value* receiverObject, llvm::Value* instanceVtable) {
TessaAssert(receiverObject->getType()->isPointerTy());
llvm::Value* createdInstanceAddress = createLlvmLoadPtr(instanceVtable, offsetof(VTable, createInstance) / sizeof(int32_t));
llvm::Function* vtableCreateInstanceFunction = getLlvmFunction(GET_LLVM_CALLINFO(VTableCreateInstance));
const llvm::FunctionType* functionType = vtableCreateInstanceFunction->getFunctionType();
llvm::Value* newInstanceAsScriptObject = createLlvmIndirectCallInstruction(createdInstanceAddress, functionType, "NewInstance", 2, receiverObject, instanceVtable);
return createBitCast(newInstanceAsScriptObject, _pointerType);
}
// Atom ivtable->init->coerceEnter(argc, argv);
llvm::Value* LlvmIRGenerator::emitCallToMethodInfoImplgr(llvm::Value* instanceVtable, int argCount, llvm::Value* llvmArguments) {
llvm::Value* loadedMethodInfo = createLlvmLoadPtr(instanceVtable, offsetof(VTable, init) / sizeof(int32_t));
llvm::Value* methodToCall = createLlvmLoadPtr(loadedMethodInfo, offsetof(MethodEnvProcHolder, _implGPR) / sizeof(int32_t));
llvm::Function* invokeFunction = getLlvmFunction(GET_LLVM_CALLINFO(InvokeReturnInt));
const llvm::FunctionType* invokeFunctionType = invokeFunction->getFunctionType();
return createLlvmIndirectCallInstruction(methodToCall, invokeFunctionType, "ConstructEarly", 3, loadedMethodInfo, createConstantInt(argCount), llvmArguments);
}
llvm::Value* LlvmIRGenerator::callEarlyBoundConstruct(ConstructInstruction* constructInstruction) {
TessaAssert(constructInstruction->isEarlyBound());
ArrayOfInstructions* callArguments = constructInstruction->getArguments();
int argCount = callArguments->size();
int argCountAdjustment = argCount - 1; // Construct prop assumes arg count - 1 as the argc parameter
TessaAssert(argCount >= 1);
Traits* classTraits = constructInstruction->getResultTraits();
Traits* instanceTraits = classTraits->itraits;
MethodInfo* constructorMethodInfo = instanceTraits->init;
MethodSignaturep constructorMethodSignature = constructorMethodInfo->getMethodSignature();
AvmAssert(constructorMethodSignature->argcOk(argCount - 1)); // caller must check this before early binding to constructor
TessaInstruction* tessaReceiver = callArguments->getInstruction(0);
llvm::Value* receiverObject = getValue(tessaReceiver);
llvm::Value* llvmArguments = createTypedArgumentsPointer(callArguments, constructorMethodSignature, argCountAdjustment);
int slotIndex = constructInstruction->getSlotId();
Traits* objectTraits = constructInstruction->getObjectTraits();
llvm::Value* receiverObjectLoaded;
if (constructInstruction->isConstructProperty()) {
receiverObjectLoaded = loadFromSlot(receiverObject, tessaReceiver->getType(), slotIndex, objectTraits);
} else {
TessaAssert(tessaReceiver->isScriptObject());
receiverObjectLoaded = receiverObject;
}
llvm::Value* vtable = loadVTable(receiverObjectLoaded, _tessaTypeFactory->scriptObjectType());
llvm::Value* instanceVtable = createLlvmLoadPtr(vtable, offsetof(VTable, ivtable) / sizeof(int32_t));
llvm::Value* createdObject = emitCallToNewInstance(receiverObjectLoaded, instanceVtable);
// arguments[0] = newInstance; // new object is receiver
TessaAssert(createdObject->getType()->isPointerTy());
TessaAssert(tessaReceiver->isScriptObject());
TessaAssert(getTessaType(constructorMethodSignature->paramTraits(0)) == _tessaTypeFactory->scriptObjectType());
createLlvmStore(llvmArguments, createdObject, 0);
emitCallToMethodInfoImplgr(instanceVtable, argCountAdjustment, llvmArguments);
return createdObject;
}
void LlvmIRGenerator::visit(ConstructPropertyInstruction* constructPropertyInstruction) {
llvm::Value* constructedProp;
if (constructPropertyInstruction->isEarlyBound()) {
constructedProp = callEarlyBoundConstruct(constructPropertyInstruction);
} else {
constructedProp = callLateBoundConstructProperty(constructPropertyInstruction);
}
TessaAssert(constructedProp != NULL);
putValue(constructPropertyInstruction, constructedProp);
}
void LlvmIRGenerator::visit(ConstructSuperInstruction* constructSuperInstruction) {
MethodInfo* methodInfo = constructSuperInstruction->getMethodInfo();
MethodSignaturep methodSignature = methodInfo->getMethodSignature();
ArrayOfInstructions* arguments = constructSuperInstruction->getArguments();
uint32_t argCount = constructSuperInstruction->getNumberOfArgs();
llvm::Value* llvmArguments = createTypedArgumentsPointer(arguments, methodSignature, argCount);
// Do vtable()->base->init->coerceenter;
llvm::Value* vtable = _methodEnvVTable;
llvm::Value* base = createLlvmLoadPtr(vtable, offsetof(VTable, base) / sizeof(int32_t));
llvm::Value* methodEnv = createLlvmLoadPtr(base, offsetof(VTable, init) / sizeof(int32_t));
llvm::Value* methodAddress = createLlvmLoadPtr(methodEnv, (offsetof(MethodEnvProcHolder,_implGPR) / sizeof(int32_t)));
const llvm::FunctionType* functionType = getInvokeFunctionType(_tessaTypeFactory->voidType());
createLlvmIndirectCallInstruction(methodAddress, functionType, "construct super early", 3, methodEnv, createConstantInt(argCount), llvmArguments);
}
std::vector<llvm::Value*>* LlvmIRGenerator::createLlvmArguments(ArrayOfInstructions* arguments) {
std::vector<llvm::Value*>* argumentVector = new std::vector<llvm::Value*>();
for (uint32_t i = 0; i < arguments->size(); i++) {
TessaInstruction* tessaInstruction = arguments->getInstruction(i);
llvm::Value* llvmValue = getValue(tessaInstruction);
argumentVector->push_back(llvmValue);
}
return argumentVector;
}
/***
* We assume that "object" is in its native representation. Ala an integer 10.
* We have to convert it to the appropriate Atom. Ugh
*/
llvm::Value* LlvmIRGenerator::createBitCast(llvm::Value* valueToCast, const llvm::Type* typeToCastTo) {
if (valueToCast->getType() == typeToCastTo) return valueToCast;
return new llvm::BitCastInst(valueToCast, typeToCastTo, "", llvmBasicBlock);
}
/***
* Given an atom, return the value in unboxed form.
*/
llvm::Value * LlvmIRGenerator::atomToNative(llvm::Value* atom, TessaTypes::Type* typeToNative) {
AvmAssert(isAtomType(atom));
if (typeToNative->isString()) {
// Have to check for string type prior to casting to pointer type
return createBitCast(createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreCoerce_s), 2, _avmcorePointer, atom), _pointerType);
} else if (isLlvmPointerType(typeToNative)) {
return AtomToScriptObject(atom);
}
if (typeToNative->isAnyType() || typeToNative->isObject()) {
return atom;
} else if (typeToNative->isBoolean()) {
llvm::Value* atomBoolean = createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreBooleanAtom), 1, atom);
return new ICmpInst(*llvmBasicBlock, ICmpInst::ICMP_EQ, atomBoolean, _trueAtom, "");
} else if (typeToNative->isUnsignedInt()) {
return createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreToUint32), 1, atom);
} else if (typeToNative->isInteger()) {
return createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreInteger), 1, atom);
} else if (typeToNative->isNumber()) {
return createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreNumber), 1, atom);
} else if (typeToNative->isString()) {
AvmAssert(false);
//return createBitCast(createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreCoerce_s), 2, _avmcorePointer, atom), _pointerType);
} else {
AvmAssert(false);
return atom;
}
}
/***
* Big big wins specializing float -> integer
* int intval = __asm__( cvttsd2si doubleValue );
* if (intval != 0x80000000)
* return intval;
* else {
* call integer_d
* }
*/
llvm::Value* LlvmIRGenerator::specializeCastFloatToInteger(llvm::Value* doubleValue) {
llvm::BasicBlock* castingErrorBlock = llvm::BasicBlock::Create(*context, "castFloatToIntErrorBlock", _llvmFunction);
llvm::BasicBlock* mergeBlock= llvm::BasicBlock::Create(*context, "castFloatToIntMerge", _llvmFunction);
llvm::BasicBlock* currentBlock = llvmBasicBlock;
/***
* if castedValue != 0x80000000
*/
llvm::Value* errorValue = createConstantInt(0x80000000);
llvm::Value* castedValue = new llvm::FPToSIInst(doubleValue, _intType, "", currentBlock);
llvm::Value* errorCondition = new llvm::ICmpInst(*currentBlock, ICmpInst::ICMP_NE, castedValue, errorValue, "");
llvm::Instruction* branchErrorInstruction = llvm::BranchInst::Create(mergeBlock, castingErrorBlock, errorCondition, currentBlock);
/***
* Work on error block
*/
llvmBasicBlock = castingErrorBlock;
llvm::Value* longCastedValue = createLlvmCallInstruction(GET_LLVM_CALLINFO(NumberToInteger), 1, doubleValue);
llvm::Instruction* branchFromErrorToMerge = llvm::BranchInst::Create(mergeBlock, castingErrorBlock);
llvmBasicBlock = mergeBlock;
llvm::PHINode* correctIntegerValue = llvm::PHINode::Create(_intType, "", mergeBlock);
correctIntegerValue->addIncoming(castedValue, currentBlock);
correctIntegerValue->addIncoming(longCastedValue, castingErrorBlock);
return correctIntegerValue;
}
llvm::Value* LlvmIRGenerator::castFloatToNative(llvm::Value* doubleValue, TessaTypes::Type* newNativeType) {
TessaAssert(doubleValue->getType() == _doubleType);
if (newNativeType->isBoolean()) {
return new llvm::FCmpInst(*llvmBasicBlock, llvm::FCmpInst::FCMP_ONE, doubleValue, createConstantDouble(0));
} else if (newNativeType->isString()) {
llvm::Value* doubleAtom = nativeToAtom(doubleValue, _tessaTypeFactory->numberType());
return atomToNative(doubleAtom, _tessaTypeFactory->stringType());
} else if (newNativeType->isObject()) {
return nativeToAtom(doubleValue, _tessaTypeFactory->numberType());
} else if (newNativeType->isUnsignedInt()) {
return new llvm::FPToUIInst(doubleValue, _uintType, "", llvmBasicBlock);
} else if (newNativeType->isInteger()) {
return specializeCastFloatToInteger(doubleValue);
} else if (newNativeType->isNumber()) {
return doubleValue;
} else {
AvmAssert(false);
}
TessaAssert(false);
return NULL;
}
llvm::Value* LlvmIRGenerator::castBooleanToNative(llvm::Value* booleanValue, TessaTypes::Type* newNativeType) {
TessaAssert(booleanValue->getType() == _booleanType);
if (newNativeType->isBoolean()) {
return booleanValue;
} else if (newNativeType->isString()) {
llvm::Value* booleanAtom = llvm::SelectInst::Create(booleanValue, _trueAtom, _falseAtom, "", llvmBasicBlock);
return createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreString), 2, _avmcorePointer, booleanAtom);
} else if (newNativeType->isObject()) {
return nativeToAtom(booleanValue, _tessaTypeFactory->boolType());
} else if (newNativeType->isUnsignedInt()) {
llvm::Value* trueInt = createConstantUnsignedInt(1);
llvm::Value* falseInt = createConstantUnsignedInt(0);
return llvm::SelectInst::Create(booleanValue, trueInt, falseInt, "", llvmBasicBlock);
} else if (newNativeType->isInteger()) {
llvm::Value* trueInt = createConstantInt(1);
llvm::Value* falseInt = createConstantInt(0);
return llvm::SelectInst::Create(booleanValue, trueInt, falseInt, "", llvmBasicBlock);
} else if (newNativeType->isNumber()) {
llvm::Value* trueInt = createConstantDouble(1);
llvm::Value* falseInt = createConstantDouble(0);
return llvm::SelectInst::Create(booleanValue, trueInt, falseInt, "", llvmBasicBlock);
} else {
AvmAssert(false);
}
TessaAssert(false);
return NULL;
}
llvm::Value* LlvmIRGenerator::castIntegerToNative(llvm::Value* integerValue, TessaTypes::Type* newNativeType) {
TessaAssert(integerValue->getType()->isIntegerTy());
if (newNativeType->isNumber()) {
return new llvm::SIToFPInst(integerValue, _doubleType, "", llvmBasicBlock);
} else if (newNativeType->isUnsignedInt()) {
return new llvm::BitCastInst(integerValue, _uintType, "", llvmBasicBlock);
} else if (newNativeType->isBoolean()) {
return new llvm::ICmpInst(*llvmBasicBlock, ICmpInst::ICMP_NE, integerValue, createConstantInt(0), "");
} else if (newNativeType->isObject() || newNativeType->isVoid()) {
// We probably have an undefined atom with VOID type
return integerValue;
} else {
printf("Changing integer to type: %s\n", newNativeType->toString().data());
TessaAssert(false);
}
TessaAssert(false);
return NULL;
}
llvm::Value* LlvmIRGenerator::castScriptObjectToNative(llvm::Value* scriptObject, TessaTypes::Type* newNativeType) {
if (newNativeType->isPointer()) {
return scriptObject;
} else if (newNativeType->isInteger()) {
return castPtrToInt(scriptObject);
} else if (newNativeType->isObject()) {
return ScriptObjectToAtom(scriptObject);
} else if (newNativeType->isBoolean()) {
llvm::Value* boxedObject = ScriptObjectToAtom(scriptObject);
return new llvm::ICmpInst(*llvmBasicBlock, ICmpInst::ICMP_NE, boxedObject, _nullObjectAtom, "");
} else if (newNativeType->isNumber()) {
llvm::Value* atomValue = ScriptObjectToAtom(scriptObject);
return atomToNative(atomValue, newNativeType);
} else if (newNativeType->isNull()) {
return _nullObjectAtom;
} else {
printf("native type is: %s\n", newNativeType->toString().data());
TessaAssert(false);
}
TessaAssert(false);
return NULL;
}
llvm::Value* LlvmIRGenerator::castUndefinedToNative(llvm::Value* undefinedValue, TessaTypes::Type* newNativeType) {
if (isLlvmPointerType(newNativeType)) {
return AtomToScriptObject(undefinedValue);
}
if (newNativeType->isNumber()) {
return createConstantDouble(0);
} else if (newNativeType->isInteger()) {
return createConstantInt(0);
} else if (newNativeType->isObject()) {
return _nullObjectAtom;
} else if (newNativeType->isVoid()) {
return undefinedValue;
} else if (newNativeType->isBoolean()) {
return createConstantBoolean(false);
} else {
printf("Going from undefined or null to: %s\n", newNativeType->toString().data());
TessaAssert(false);
}
TessaAssert(false);
return NULL;
}
llvm::Value* LlvmIRGenerator::castAvmObjectToNative(llvm::Value* avmObject, TessaTypes::Type* newNativeType) {
TessaAssert(avmObject->getType()->isIntegerTy());
if (newNativeType->isPointer()) {
return AtomToScriptObject(avmObject);
} else if (newNativeType->isNumber()) {
return createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreAtomToNumberFast), 1, avmObject);
} else if (newNativeType->isInteger()) {
//AvmAssert(false); // Ensure we have a 32 bit signed integer, otherw se have to call integer, not AvmCore::integer_i
return createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreInteger), 1, avmObject);
} else if (newNativeType->isBoolean()) {
return new llvm::ICmpInst(*llvmBasicBlock, llvm::ICmpInst::ICMP_NE, avmObject, _nullObjectAtom, "");
} else {
printf("Going from AvmObject to native: %s\n", newNativeType->toString().data());
TessaAssert(false);
}
TessaAssert(false);
return NULL;
}
llvm::Value* LlvmIRGenerator::castStringToNative(llvm::Value* stringValue, TessaTypes::Type* newNativeType) {
TessaAssert(stringValue->getType()->isPointerTy());
if (newNativeType->isObject() || newNativeType->isScriptObject()) {
return stringValue;
} else if (newNativeType->isBoolean()) {
llvm::Value* atomString = nativeToAtom(stringValue, _tessaTypeFactory->stringType());
// AvmCore boolean returns an int8ty, convert it to a int1ty
llvm::Value* avmcoreBoolean = createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreBoolean), 1, atomString);
// Compare to shift back down to a int1ty
return new llvm::ICmpInst(*llvmBasicBlock, llvm::ICmpInst::ICMP_NE, avmcoreBoolean, createConstantInt(0), "");
} else if (newNativeType->isNull()) {
return _nullObjectAtom;
} else {
printf("Error casting string to native type %s\n", newNativeType->toString().data());
TessaAssert(false);
}
TessaAssert(false);
return NULL;
}
/***
* All llvm values must be typed. This creates the appropriate casting operations for primitive types. (Eg int -> double).
*/
llvm::Value* LlvmIRGenerator::castToNative(llvm::Value* native, TessaTypes::Type* nativeType, TessaTypes::Type* newNativeType) {
if (nativeType == newNativeType) {
return (llvm::Instruction*) native;
}
if (newNativeType->isAnyType()) {
return nativeToAtom(native, nativeType);
}
if (newNativeType->isString()) {
llvm::Value* atomValue = nativeToAtom(native, nativeType);
return createBitCast(createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreString), 2, _avmcorePointer, atomValue), _pointerType);
}
if (nativeType->isBoolean()) {
return castBooleanToNative(native, newNativeType);
} else if (nativeType->isUnsignedInt()) {
if (newNativeType->isNumber()) {
return new llvm::UIToFPInst(native, _doubleType, "", llvmBasicBlock);
} else if (newNativeType->isInteger()) {
return (llvm::Instruction*)native;
} else if (newNativeType == _tessaTypeFactory->boolType()) {
return new llvm::ICmpInst(*llvmBasicBlock, ICmpInst::ICMP_NE, native, createConstantInt(0), "");
} else {
printf("native type is: %s\n", newNativeType->toString().data());
TessaAssert(false);
return native;
}
} else if (nativeType->isInteger()) {
return castIntegerToNative(native, newNativeType);
} else if (nativeType->isNumber()) {
return castFloatToNative(native, newNativeType);
} else if (nativeType->isString()) {
return castStringToNative(native, newNativeType);
} else if (nativeType->isPointer()) {
return castScriptObjectToNative(native, newNativeType);
} else if (nativeType->isObject()) {
return castAvmObjectToNative(native, newNativeType);
} else if (nativeType->isAnyType()) {
return atomToNative(native, newNativeType);
} else if (nativeType->isUndefined() || nativeType->isNull()) {
return castUndefinedToNative(native, newNativeType);
} else {
printf("Casting native %s to %s\n", nativeType->toString().data(), newNativeType->toString().data());
AvmAssert(false);
return NULL;
}
}
llvm::Value* LlvmIRGenerator::nativeToAtom(llvm::Value* object, Traits* objectTraits) {
TessaTypes::Type* tessaType = getTessaType(objectTraits);
return nativeToAtom(object, tessaType);
}
/***
* ActionSCript objects in JITted code are represented as Atoms. Many of these atoms are actually the
* AvmCore::ScriptObject. Cast the Atom -> ScriptObject* pointer type
*/
llvm::Instruction* LlvmIRGenerator::AtomToScriptObject(llvm::Value* scriptObject) {
TessaAssert(scriptObject->getType()->isIntegerTy());
// To go from atom to AvmCore::ScriptObject : ptr & ~7
return castIntToPtr(llvm::BinaryOperator::Create(Instruction::And, scriptObject, createConstantInt(~7), "", llvmBasicBlock));
}
// Go from a native AvmCore::scriptObject back to atom
llvm::Instruction* LlvmIRGenerator::ScriptObjectToAtom(llvm::Value* scriptObject) {
// Do C equivalent of return kObjectType|(uintptr)this;
TessaAssert(scriptObject->getType()->isPointerTy());
llvm::Value* intObject = castPtrToInt(scriptObject);
return llvm::BinaryOperator::Create(Instruction::Or, intObject, createConstantInt(kObjectType), "", llvmBasicBlock);
}
/***
* If the int value is a constant, return the atom integer value instead of calling
* AvmCore::intToAtom
*/
llvm::Value* LlvmIRGenerator::optimizeNativeIntegerToAtom(llvm::Value* intValue) {
//return createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreIntToAtom), 2, _avmcorePointer, intValue);
if (dynamic_cast<llvm::ConstantInt*>(intValue)) {
llvm::ConstantInt* constantInt = dynamic_cast<llvm::ConstantInt*>(intValue);
int rawIntValue = constantInt->getSExtValue();
if (atomIsValidIntptrValue(rawIntValue)) {
return createConstantInt(core->intToAtom(rawIntValue));
}
}
return createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreIntToAtom), 2, _avmcorePointer, intValue);
}
llvm::Value* LlvmIRGenerator::nativeToAtom(llvm::Value* value, TessaTypes::Type* typeOfValue) {
if (typeOfValue->isBoolean()) {
return llvm::SelectInst::Create(value, _trueAtom, _falseAtom, "Boolean toAtom", llvmBasicBlock);
} else if (typeOfValue->isString()) {
// (AtomConstants::kStringType | uintptr_t(this));
value = castPtrToInt(value);
return llvm::BinaryOperator::Create(llvm::Instruction::Or, value, createConstantInt(kStringType), "", llvmBasicBlock);
} else if (typeOfValue->isUnsignedInt()) {
return createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreUintToAtom), 2, _avmcorePointer, value);
} else if (typeOfValue->isInteger()) {
return optimizeNativeIntegerToAtom(value);
} else if (typeOfValue->isNumber()) {
return createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreDoubleToAtom), 2, _avmcorePointer, value);
} else if (typeOfValue->isPointer()) {
return ScriptObjectToAtom(value);
} else {
// Value should already be an atom
TessaAssert(isAtomType(value));
return value;
}
TessaAssert(false);
return NULL;
}
TessaTypes::Type* LlvmIRGenerator::getTessaType(Traits* traits) {
avmplus::BuiltinType type = Traits::getBuiltinType(traits);
switch (type)
{
case BUILTIN_number:
return _tessaTypeFactory->numberType();
case BUILTIN_any:
return _tessaTypeFactory->anyType();
case BUILTIN_object:
return _tessaTypeFactory->objectType();
case BUILTIN_void:
return _tessaTypeFactory->voidType();
case BUILTIN_int:
return _tessaTypeFactory->integerType();
case BUILTIN_uint:
return _tessaTypeFactory->uintType();
case BUILTIN_boolean:
return _tessaTypeFactory->boolType();
case BUILTIN_string:
return _tessaTypeFactory->stringType();
case BUILTIN_array:
return _tessaTypeFactory->anyArrayType();
case BUILTIN_regexp:
case BUILTIN_none:
return _tessaTypeFactory->scriptObjectType();
case BUILTIN_namespace:
{
TessaAssert(false);
return _tessaTypeFactory->anyType();
}
case BUILTIN_vector:
return _tessaTypeFactory->anyVectorType();
case BUILTIN_vectorobj:
return _tessaTypeFactory->objectVectorType();
case BUILTIN_vectoruint:
return _tessaTypeFactory->uintVectorType();
case BUILTIN_vectorint:
return _tessaTypeFactory->intVectorType();
case BUILTIN_vectordouble:
return _tessaTypeFactory->numberVectorType();
case BUILTIN_function:
case BUILTIN_date:
case BUILTIN_class:
{
return _tessaTypeFactory->scriptObjectType();
}
default:
{
printf("No tessa type for builtin type: %d\n", type);
TessaAssert(false);
return _tessaTypeFactory->anyType();
}
}
}
/***
* AVM defaults to saying this is a script object
*/
llvm::Value* LlvmIRGenerator::loadVTable(llvm::Value* object, TessaTypes::Type* tessaType) {
// Assumes object is a boxed Atom
if (tessaType->isArray() || tessaType->isScriptObject()) {
return createLlvmLoadPtr(object, offsetof(ScriptObject, vtable) / sizeof(int32_t));
} else {
// Atom
//TessaAssert((tessaType == TESSA_ANY) || (tessaType == ObjectType::getObjectType()));
// Can optimize this a bit later
llvm::Value* objectAtom = nativeToAtom(object, tessaType);
return createBitCast(createLlvmCallInstruction(GET_LLVM_CALLINFO(toVtable), 2, _toplevelPointer, objectAtom), _pointerType);
}
}
void LlvmIRGenerator::checkPointerSizes() {
/***
* All of our calculations assume int, void*, ptr* are the same time. Otherwise, we misaling with visual studio.
* We also assume doubles are 8 bytes
*/
TessaAssert(sizeof(intptr_t) == 4);
TessaAssert(sizeof(uintptr_t) == 4);
TessaAssert(sizeof(void*) == 4);
TessaAssert(sizeof(double) == 8);
}
/***
* The arguments pointer consists of all the arguments to a method call.
* Each argument should be unboxed into their native value. Thus, any calls to this compiled method must have already
* unboxed the values of the arguments.
* arguments look like this:
* Arguments[0] = "this" pointer unboxed as a value.
* Arguments[1 - n] = values unboxed.
* In addition, all double values are 8 byte aligned. The spacing between 8 byte alignments are pads.
*/
llvm::Value* LlvmIRGenerator::createTypedArgumentsPointer(ArrayOfInstructions* arrayOfInstructions, MethodSignaturep methodSignature, int argCount) {
bool isSigned = false;
llvm::Value* numberOfInstructions = this->createConstantInt(arrayOfInstructions->size());
int paramCount = methodSignature->param_count();
checkPointerSizes();
TessaAssert(arrayOfInstructions->size() <= maxArgPointerSize);
checkPointerSizes();
TessaAssert((int32_t) arrayOfInstructions->size() >= methodSignature->requiredParamCount());
int displacement = 0;
for (int i = 0; i <= argCount; i++) {
TessaInstruction* arrayElement = arrayOfInstructions->getInstruction(i);
TessaTypes::Type* instructionType = arrayElement->getType();
Traits* paramTraits = i <= paramCount ? methodSignature ->paramTraits(i) : NULL;
TessaTypes::Type* declaredParamType = getTessaType(paramTraits);
llvm::Value* coercedParamValue = castToNative(getValue(arrayElement), instructionType, declaredParamType);
if (isLlvmPointerType(declaredParamType)) {
createLlvmStorePointer(_allocedArgumentsPointer, coercedParamValue, displacement / sizeof(int32_t));
displacement += sizeof(intptr_t);
} else if (declaredParamType == _tessaTypeFactory->numberType()) {
llvm::Value* doubleAddress = doPointerArithmetic(_allocedArgumentsPointer, displacement);
createLlvmStoreDouble(doubleAddress, coercedParamValue, 0);
displacement += sizeof(double);
} else if (declaredParamType == _tessaTypeFactory->boolType()) {
// llvm stores booleans as 1 bit values. We have to expand it to the size of an int
coercedParamValue = castToNative(coercedParamValue, _tessaTypeFactory->boolType(), _tessaTypeFactory->integerType());
createLlvmStoreInt(_allocedArgumentsPointer, coercedParamValue, displacement / sizeof(int32_t));
displacement += sizeof(void*);
} else {
TessaAssert((declaredParamType->isInteger()) || (declaredParamType->isUnsignedInt())
|| (declaredParamType->isObject()) || (declaredParamType->isAnyType()));
createLlvmStoreInt(_allocedArgumentsPointer, coercedParamValue, displacement / sizeof(int32_t));
displacement += sizeof(void*);
}
}
return _allocedArgumentsPointer;
}
/***
* Creates an array of atoms. Each value will be converted to an atom
*/
llvm::Value* LlvmIRGenerator::createAtomArgumentsPointer(ArrayOfInstructions* arrayOfInstructions) {
bool isSigned = false;
TessaAssert(arrayOfInstructions->size() <= maxArgPointerSize);
for (uint32_t i = 0; i < arrayOfInstructions->size(); i++) {
TessaInstruction* arrayElement = arrayOfInstructions->getInstruction(i);
TessaTypes::Type* instructionType = arrayElement->getType();
llvm::Value* atomValue = nativeToAtom(getValue(arrayElement), instructionType);
// Have to cast this because alloced is of pointer type
atomValue = castIntToPtr(atomValue);
createLlvmStore(_allocedArgumentsPointer, atomValue, i);
}
return _allocedArgumentsPointer;
}
llvm::Value* LlvmIRGenerator::castReturnValue(CallInstruction* callInstruction, llvm::Value* returnValue) {
TessaTypes::Type* returnType = callInstruction->getType();
Traits* resultTraits = callInstruction->getResultTraits();
if (returnType->isPointer()) {
if (isAtomType(returnValue)) {
AvmAssert(callInstruction->isInlined());
return castToNative(returnValue, callInstruction->resolve()->getType(), returnType);
} else {
TessaAssert(returnValue->getType()->isPointerTy());
return createBitCast(returnValue, _pointerType);
}
} else if (returnType->isBoolean()) {
if (isAtomType(returnValue)) {
return castToNative(returnValue, _tessaTypeFactory->integerType(), _tessaTypeFactory->boolType());
} else {
TessaAssert(returnValue->getType() == llvm::Type::getInt1Ty(*context));
return returnValue;
}
} else if (returnType->isObject()) {
// Have to coerce undefined values to null types. Can optimize this away with the verifier
llvm::Value* isUndefined = new llvm::ICmpInst(*llvmBasicBlock, llvm::ICmpInst::ICMP_EQ, _undefinedAtom, returnValue, "");
return llvm::SelectInst::Create(isUndefined, _nullObjectAtom, returnValue, "", llvmBasicBlock);
} else {
return returnValue;
}
}
const llvm::FunctionType* LlvmIRGenerator::getInvokeFunctionType(TessaTypes::Type* callReturnType) {
const LlvmCallInfo* llvmCallInfo;
if (callReturnType->isNumber()) {
llvmCallInfo = GET_LLVM_CALLINFO(InvokeReturnNumber);
} else if (callReturnType->isPointer()) {
llvmCallInfo = GET_LLVM_CALLINFO(InvokeReturnPointer);
} else {
llvmCallInfo = GET_LLVM_CALLINFO(InvokeReturnInt);
}
return getLlvmFunction(llvmCallInfo)->getFunctionType();
}
const llvm::FunctionType* LlvmIRGenerator::getInterfaceInvokeFunctionType(TessaTypes::Type* interfaceReturnType) {
const LlvmCallInfo* llvmCallInfo;
if (interfaceReturnType->isNumber()) {
llvmCallInfo = GET_LLVM_CALLINFO(InterfaceInvokeReturnNumber);
} else if (interfaceReturnType->isPointer()) {
llvmCallInfo = GET_LLVM_CALLINFO(InterfaceInvokeReturnPointer);
} else {
llvmCallInfo = GET_LLVM_CALLINFO(InterfaceInvokeReturnInt);
}
return getLlvmFunction(llvmCallInfo)->getFunctionType();
}
const llvm::FunctionType* LlvmIRGenerator::getCallCacheHandlerFunctionType() {
return getLlvmFunction(GET_LLVM_CALLINFO(CallCacheHandler))->getFunctionType();
}
const llvm::FunctionType* LlvmIRGenerator::getGetCacheHandlerFunctionType() {
return getLlvmFunction(GET_LLVM_CALLINFO(GetCacheHandler))->getFunctionType();
}
const llvm::FunctionType* LlvmIRGenerator::getSetCacheHandlerFunctionType() {
return getLlvmFunction(GET_LLVM_CALLINFO(SetCacheHandler))->getFunctionType();
}
llvm::Value* LlvmIRGenerator::loadMethodEnv(TessaInstruction* receiverObject, int methodId) {
llvm::Value* llvmReceiverObject = getValue(receiverObject);
llvm::Value* vtable = loadVTable(llvmReceiverObject, receiverObject->getType());
int methodOffset = int32_t(offsetof(VTable, methods) + sizeof(MethodEnv*) * methodId) / sizeof(int32_t); // divide by sizeof(int) since llvm multiplies by it later
return createLlvmLoadPtr(vtable, methodOffset);
}
llvm::Value* LlvmIRGenerator::loadMethodInfo(llvm::Value* loadedMethodEnv) {
TessaAssert(loadedMethodEnv->getType()->isPointerTy());
int methodInfoOffset = int32_t(offsetof(MethodEnv, method)) / sizeof(int32_t);
return createLlvmLoadPtr(loadedMethodEnv, methodInfoOffset);
}
// Do MethodInfo*->_implGPR(MethodEnv, int argCount, Typed Args*) - big win to inline this
llvm::Value* LlvmIRGenerator::callMethodInfoImplGPR(llvm::Value* loadedMethodInfo, llvm::Value* loadedMethodEnv, llvm::Value* argCount, llvm::Value* argumentsPointer, TessaTypes::Type* resultType) {
const llvm::FunctionType* invokeFunctionType = getInvokeFunctionType(resultType);
llvm::PointerType* invokeFunctionPointer = llvm::PointerType::get(invokeFunctionType, 0);
llvm::Value* methodToCall = createLlvmLoadPtr(loadedMethodInfo, offsetof(MethodInfo, _implGPR) / sizeof(int32_t));
methodToCall = createBitCast(methodToCall, invokeFunctionPointer);
return createLlvmIndirectCallInstruction(methodToCall, invokeFunctionType, "MethodInfoInvoke", 3, loadedMethodEnv, argCount, argumentsPointer);
}
llvm::Value* LlvmIRGenerator::executeNonInlinedCallInstruction(TessaInstructions::CallInstruction* callInstruction, int argCount) {
TessaAssert(false);
int methodId = callInstruction->getMethodId();
Traits* resultTraits = callInstruction->getResultTraits();
llvm::Value* loadedMethodEnv = loadMethodEnv(callInstruction->getReceiverObject(), methodId);
llvm::Value* loadedMethodInfo = loadMethodInfo(loadedMethodEnv);
llvm::Value* argumentsPointer = createTypedArgumentsPointer(callInstruction->getArguments(), callInstruction->getMethodInfo()->getMethodSignature(), callInstruction->getNumberOfArgs());
TessaAssert(argCount == callInstruction->getNumberOfArgs());
llvm::Value* llvmArgCount = createConstantInt(argCount);
llvm::Value* returnValue = callMethodInfoImplGPR(loadedMethodInfo, loadedMethodEnv, llvmArgCount, argumentsPointer, callInstruction->getType());
return castReturnValue(callInstruction, returnValue);
}
/***
* Call this method:
* Atom MethodInfoInvoke(MethodInfo* methodInfo, MethodEnv* env, int argc, Atom* args) { }
*/
llvm::Value* LlvmIRGenerator::executeCallInstruction(TessaInstructions::CallInstruction* callInstruction, int argCount) {
TessaAssert(!callInstruction->isDynamicMethod());
return executeNonInlinedCallInstruction(callInstruction, argCount);
}
llvm::Value* LlvmIRGenerator::executeDynamicCallInstruction(CallInstruction* callInstruction, int argCount) {
TessaAssert(callInstruction->isDynamicMethod() && !callInstruction->hasAbcOpcode());
TessaTypes::Type* functionObjectType = callInstruction->getFunctionObject()->getType();
llvm::Value* functionObject = getValue(callInstruction->getFunctionObject());
if (functionObjectType == _tessaTypeFactory->scriptObjectType()) {
functionObject = ScriptObjectToAtom(functionObject);
}
//TessaAssert(callInstruction->getFunctionObject()->isScriptObject());
TessaAssert(isAtomType(functionObject));
llvm::Value* arguments = createAtomArgumentsPointer(callInstruction->getArguments());
return createLlvmCallInstruction(GET_LLVM_CALLINFO(op_call_toplevel), 4, _toplevelPointer, functionObject, createConstantInt(argCount), arguments);
}
llvm::Value* LlvmIRGenerator::executeAbcCallInstruction(CallInstruction* callInstruction, int argCount) {
TessaAssert(callInstruction->hasAbcOpcode());
llvm::Value* arguments = createAtomArgumentsPointer(callInstruction->getArguments());
llvm::Value* llvmArgCount = createConstantInt(argCount);
switch (callInstruction->getAbcOpcode()) {
case OP_applytype:
{
llvm::Value* functionObject = getValue(callInstruction->getFunctionObject());
functionObject = nativeToAtom(functionObject, callInstruction->getFunctionObject()->getType());
// Have to do arguments + 1 because arguments[0] is the function object, and apply_type Atom* arg can't have that
return createLlvmCallInstruction(GET_LLVM_CALLINFO(MethodEnvOp_applytype), 4, _envPointer, functionObject, llvmArgCount, arguments);
}
case OP_newfunction:
{
// ArgCount doesn't count the "this" pointer
TessaAssert(argCount == 0);
TessaInstruction* methodIndex = callInstruction->getArguments()->getInstruction(0);
llvm::Value* llvmMethodIndex = getValue(methodIndex);
llvmMethodIndex = nativeToAtom(llvmMethodIndex, methodIndex->getType());
llvm::Instruction* newFunctionResult = createLlvmCallInstruction(GET_LLVM_CALLINFO(MethodEnvNewFunction), 5, _envPointer, _avmcorePointer, _currentScopeDepth, _scopeStack, llvmMethodIndex);
return createBitCast(newFunctionResult, _pointerType);
}
default:
TessaAssert(false);
}
TessaAssert(false);
return NULL;
}
void LlvmIRGenerator::visit(CallInstruction* callInstruction) {
int argCount = callInstruction->getNumberOfArgs();
llvm::Value* llvmCallInstruction;
if (callInstruction->hasAbcOpcode()) {
llvmCallInstruction = executeAbcCallInstruction(callInstruction, argCount);
} else if (callInstruction->isDynamicMethod()) {
llvmCallInstruction = executeDynamicCallInstruction(callInstruction, argCount);
} else {
TessaAssert(false);
llvmCallInstruction = executeCallInstruction(callInstruction, argCount);
}
TessaAssert(llvmCallInstruction != NULL);
putValue(callInstruction, llvmCallInstruction);
}
void LlvmIRGenerator::restoreMethodEnvPointers() {
_methodEnvCallStack->removeLast();
_toplevelPointerStack->removeLast();
_methodEnvScopeChainStack->removeLast();
_methodEnvVTableStack->removeLast();
_envPointer = _methodEnvCallStack->last();
_toplevelPointer = _toplevelPointerStack->last();
_methodEnvScopeChain = _methodEnvScopeChainStack->last();
_methodEnvVTable = _methodEnvVTableStack->last();
}
void LlvmIRGenerator::restoreScopeStackPointers() {
_scopeStack = _scopeStackCallStack->removeLast();
_currentScopeDepth = _scopeStackCountStack->removeLast();
}
void LlvmIRGenerator::visit(CallVirtualInstruction* callVirtualInstruction) {
llvm::Value* returnValue = NULL;
if (callVirtualInstruction->isInlined()) {
returnValue = castReturnValue(callVirtualInstruction, getValue(callVirtualInstruction->resolve()));
restoreMethodEnvPointers();
restoreScopeStackPointers();
methodInfo = _methodInfoStack->removeLast();
} else {
LoadVirtualMethodInstruction* loadVirtualMethod = callVirtualInstruction->getLoadedMethodToCall();
llvm::Value* loadedMethodEnv = getValue(loadVirtualMethod->getLoadedMethodEnv());
llvm::Value* loadedMethodInfo = getValue(loadVirtualMethod->getLoadedMethodInfo());
int argCount = callVirtualInstruction->getNumberOfArgs();
llvm::Value* llvmArgCount = createConstantInt(argCount);
llvm::Value* argumentsPointer = createTypedArgumentsPointer(callVirtualInstruction->getArguments(), callVirtualInstruction->getMethodInfo()->getMethodSignature(), argCount);
returnValue = callMethodInfoImplGPR(loadedMethodInfo, loadedMethodEnv, llvmArgCount, argumentsPointer, callVirtualInstruction->getType());
}
returnValue = castReturnValue(callVirtualInstruction, returnValue);
putValue(callVirtualInstruction, returnValue);
}
void LlvmIRGenerator::visit(CallStaticInstruction* callStaticInstruction) {
TessaAssert(false);
}
void LlvmIRGenerator::visit(LoadVirtualMethodInstruction* loadVirtualMethodInstruction) {
llvm::Value* loadedMethodEnv = loadMethodEnv(loadVirtualMethodInstruction->getReceiverObject(), loadVirtualMethodInstruction->getMethodId());
llvm::Value* loadedMethodInfo = loadMethodInfo(loadedMethodEnv);
putValue(loadVirtualMethodInstruction->getLoadedMethodEnv(), loadedMethodEnv);
putValue(loadVirtualMethodInstruction->getLoadedMethodInfo(), loadedMethodInfo);
}
void LlvmIRGenerator::visit(CallInterfaceInstruction* callInterfaceInstruction) {
MethodInfo* methodInfo = callInterfaceInstruction->getMethodInfo();
MethodSignaturep methodSignature = methodInfo->getMethodSignature();
int argCount = callInterfaceInstruction->getNumberOfArgs();
llvm::Value* receiverObject = getValue(callInterfaceInstruction->getReceiverObject());
llvm::Value* llvmArguments = createTypedArgumentsPointer(callInterfaceInstruction->getArguments(), methodSignature, argCount);
llvm::Value* vtable = loadVTable(receiverObject, callInterfaceInstruction->getReceiverObject()->getType());
// note, could be MethodEnv* or ImtThunkEnv*
int index = int(callInterfaceInstruction->getMethodId() % VTable::IMT_SIZE);
int offset = (offsetof(VTable,imt) + (sizeof(ImtThunkEnv*) * index)) / sizeof(int32_t); // Let LLVM recalculate
llvm::Value* methodEnv = createLlvmLoadPtr(vtable, offset);
llvm::Value* methodIid = createConstantPtr((intptr_t) callInterfaceInstruction->getMethodId());
llvm::Value* methodAddress = createLlvmLoadPtr(methodEnv, (offsetof(MethodEnvProcHolder, _implGPR)) / sizeof(int32_t));
TessaTypes::Type* returnType = callInterfaceInstruction->getType();
int callInterfaceCount = 4;
const llvm::FunctionType* indirectType = getInterfaceInvokeFunctionType(returnType);
llvm::CallInst* returnValue = createLlvmIndirectCallInstruction(methodAddress, indirectType, "call interface", callInterfaceCount,
methodEnv, createConstantInt(argCount), llvmArguments, methodIid
);
llvm::Value* castedReturnValue = castReturnValue(callInterfaceInstruction, returnValue);
TessaAssert(castedReturnValue != NULL);
putValue(callInterfaceInstruction, castedReturnValue);
}
llvm::Value* LlvmIRGenerator::callLateBoundCallSuper(CallSuperInstruction* callSuperInstruction) {
TessaAssert(false);
llvm::Value* receiverObject = getValue(callSuperInstruction->getReceiverObject());
TessaAssert(callSuperInstruction->getReceiverObject()->getType() == _tessaTypeFactory->scriptObjectType());
llvm::Value* receiverObjectAtom = ScriptObjectToAtom(receiverObject);
llvm::Value* arguments = createAtomArgumentsPointer(callSuperInstruction->getArguments());
llvm::Value* argCount = createConstantInt(callSuperInstruction->getNumberOfArgs());
const Multiname* multiname = callSuperInstruction->getMultiname();
if (multiname->isRuntime()) {
TessaAssert(false);
}
createLlvmCallInstruction(GET_LLVM_CALLINFO(MethodEnvNullCheck), 2, _envPointer, receiverObjectAtom);
return createLlvmCallInstruction(GET_LLVM_CALLINFO(MethodEnvCallSuper), 4, _envPointer, createConstantPtr((intptr_t)multiname), argCount, arguments);
}
llvm::Value* LlvmIRGenerator::callEarlyBoundCallSuper(CallSuperInstruction* callSuperInstruction) {
TessaAssert(callSuperInstruction->isEarlyBound());
TessaInstruction* tessaReceiverObject = callSuperInstruction->getReceiverObject();
TessaAssert(tessaReceiverObject->isScriptObject());
llvm::Value* receiverObject = getValue(callSuperInstruction->getReceiverObject());
int argCount = callSuperInstruction->getNumberOfArgs();
MethodInfo* methodInfo = callSuperInstruction->getMethodInfo();
MethodSignaturep methodSignature = methodInfo->getMethodSignature();
TessaAssert(methodSignature->argcOk(argCount));
int methodId = callSuperInstruction->getMethodId();
// Do MethodEnv->method->implgpr()
llvm::Value* baseVtable = createLlvmLoadPtr(_methodEnvVTable, offsetof(VTable, base) / sizeof(int32_t));
int offset = int32_t(offsetof(VTable, methods) + sizeof(MethodEnv*) * methodId) / sizeof(int32_t);
llvm::Value* loadedMethodEnv = createLlvmLoadPtr(baseVtable, offset);
llvm::Value* methodAddress = createLlvmLoadPtr(loadedMethodEnv, offsetof(MethodEnvProcHolder,_implGPR) / sizeof(int32_t));
llvm::Value* arguments = createTypedArgumentsPointer(callSuperInstruction->getArguments(), methodSignature, argCount);
const llvm::FunctionType* invokeType = getInvokeFunctionType(callSuperInstruction->getType());
return createLlvmIndirectCallInstruction(methodAddress, invokeType, "callSuperEarly", 3, loadedMethodEnv, createConstantInt(argCount), arguments);
}
void LlvmIRGenerator::visit(CallSuperInstruction* callSuperInstruction) {
const Multiname* multiname = callSuperInstruction->getMultiname();
if (multiname->isRuntime()) {
TessaAssert(false);
}
llvm::Value* result;
if (callSuperInstruction->isEarlyBound()) {
result = callEarlyBoundCallSuper(callSuperInstruction);
} else {
result = callLateBoundCallSuper(callSuperInstruction);
}
TessaAssert(result != NULL);
putValue(callSuperInstruction, result);
}
llvm::Value* LlvmIRGenerator::callPropertyLateBound(CallPropertyInstruction* callPropertyInstruction) {
TessaAssert(!callPropertyInstruction->hasValidCacheSlot());
const Multiname* propertyName = callPropertyInstruction->getProperty();
if (propertyName->isRuntime()) {
TessaAssert(false);
}
TessaInstruction* tessaBaseObject = callPropertyInstruction->getReceiverObject()->resolve();
TessaTypes::Type* receiverType = tessaBaseObject->getType();
llvm::Value* llvmPropertyName = createConstantPtr((intptr_t)propertyName);
llvm::Value* receiverObject = nativeToAtom(getValue(tessaBaseObject), receiverType);
llvm::Value* arguments = createAtomArgumentsPointer(callPropertyInstruction->getArguments());
llvm::Value* argCount = createConstantInt(callPropertyInstruction->getNumberOfArgs());
llvm::Value* vtable = loadVTable(receiverObject, _tessaTypeFactory->anyType());
// We can't do anything at all
return createLlvmCallInstruction(GET_LLVM_CALLINFO(ToplevelCallProperty), 6, _toplevelPointer, receiverObject, llvmPropertyName, argCount, arguments, vtable);
}
llvm::Value* LlvmIRGenerator::callPropertyWithCallCache(CallPropertyInstruction* callPropertyInstruction) {
TessaAssert(callPropertyInstruction->hasValidCacheSlot());
CallCache* cacheSlot = callPropertyInstruction->cacheSlot;
int argCount = 5;
TessaInstruction* tessaBaseObject = callPropertyInstruction->getReceiverObject();
TessaTypes::Type* receiverType = tessaBaseObject->getType();
llvm::Value* receiverObject = nativeToAtom(getValue(tessaBaseObject), receiverType);
llvm::Value* atomArguments = createAtomArgumentsPointer(callPropertyInstruction->getArguments());
llvm::Value* callCacheAddress = createConstantPtr((intptr_t)cacheSlot);
llvm::Value* cacheHandler = createLlvmLoadPtr(callCacheAddress, (callPropertyInstruction->cacheHandlerOffset / sizeof(int32_t)));
llvm::Value* callPropArgCount = createConstantInt(callPropertyInstruction->getNumberOfArgs());
const llvm::FunctionType* callCacheFunctionType = getCallCacheHandlerFunctionType();
// we call (*cache->handler)(cacheAddress, Atom obj, argc, Atom args*, MethodEnv*)
return createLlvmIndirectCallInstruction(cacheHandler, callCacheFunctionType, "CallPropCache", argCount,
callCacheAddress, receiverObject, callPropArgCount, atomArguments, _envPointer);
}
llvm::Value* LlvmIRGenerator::callPropertySlotBound(CallPropertyInstruction* callPropertyInstruction) {
TessaAssert(callPropertyInstruction->isSlotBound());
llvm::Value* functionValue = getValue(callPropertyInstruction->getFunctionValue());
llvm::Value* functionAtom = functionValue;
if (!functionValue->getType()->isPointerTy()) {
functionAtom = nativeToAtom(functionValue, callPropertyInstruction->getFunctionValue()->getType());
}
llvm::Value* atomArguments = createAtomArgumentsPointer(callPropertyInstruction->getArguments());
int argCount = callPropertyInstruction->getNumberOfArgs();
return createLlvmCallInstruction(GET_LLVM_CALLINFO(op_call_toplevel), 4, _toplevelPointer, functionAtom, createConstantInt(argCount), atomArguments);
}
void LlvmIRGenerator::visit(CallPropertyInstruction* callPropertyInstruction) {
llvm::Value* result;
if (callPropertyInstruction->hasValidCacheSlot()) {
result = callPropertyWithCallCache(callPropertyInstruction);
} else {
result = callPropertyLateBound(callPropertyInstruction);
}
TessaAssert(result != NULL);
putValue(callPropertyInstruction, result);
}
void LlvmIRGenerator::visit(ConditionalBranchInstruction* conditionalBranchInstruction) {
TessaInstruction* branchCondition = conditionalBranchInstruction->getBranchCondition();
TessaAssert(branchCondition->isBoolean());
llvm::Value* evaluatedCondition = getValue(branchCondition);
TessaVM::BasicBlock* tessaTrueTarget = conditionalBranchInstruction->getTrueTarget();
TessaVM::BasicBlock* tessaFalseTarget = conditionalBranchInstruction->getFalseTarget();
llvm::BasicBlock* trueBasicBlock = getLlvmBasicBlock(tessaTrueTarget);
llvm::BasicBlock* falseBasicBlock = getLlvmBasicBlock(tessaFalseTarget);
AvmAssert(isBoolType(evaluatedCondition));
llvm::Instruction* llvmBranchInstruction = llvm::BranchInst::Create(trueBasicBlock, falseBasicBlock, evaluatedCondition, llvmBasicBlock);
putValue(conditionalBranchInstruction, llvmBranchInstruction);
}
void LlvmIRGenerator::visit(UnconditionalBranchInstruction* unconditionalBranchInstruction) {
llvm::BasicBlock* targetBlock = getLlvmBasicBlock(unconditionalBranchInstruction->getBranchTarget());
llvm::Instruction* llvmUnconditionalBranch = llvm::BranchInst::Create(targetBlock, llvmBasicBlock);
putValue(unconditionalBranchInstruction, llvmUnconditionalBranch);
}
/***
* When an AS3 variable is defined with the var keyword, it also has type information. However, before that point in the program,
* the variable is defined as the undefined atom. If we have that case in a phi, where one operand is undefined, and the other is the defined var,
* we have to satisfy LLVM's type requirements. So here, insert a cast from the incoming edge casting undefined to the appropriate type.
*/
llvm::Value* LlvmIRGenerator::castUndefinedOperandInIncomingEdge(llvm::Value* castedIncomingValue, llvm::Instruction* incomingTerminator, TessaTypes::Type* tessaPhiType) {
TessaAssert(incomingTerminator->isTerminator());
if (castedIncomingValue == _undefinedAtom) {
if (tessaPhiType->isNumber()) {
castedIncomingValue = new llvm::SIToFPInst(castedIncomingValue, _doubleType, "", incomingTerminator);
} else if (tessaPhiType->isPointer()) {
castedIncomingValue = new llvm::IntToPtrInst(castedIncomingValue, _pointerType, "", incomingTerminator);
} else if (tessaPhiType->isBoolean()) {
castedIncomingValue = createConstantBoolean(false);
}
}
return castedIncomingValue;
}
llvm::Value* LlvmIRGenerator::insertCastInIncomingBlock(llvm::Value* castedIncomingValue, llvm::BasicBlock* incomingBlock, TessaTypes::Type* tessaPhiType, TessaTypes::Type* tessaIncomingType) {
if (tessaPhiType != tessaIncomingType) {
/***
* Ugly ugly hack since castToNative may insert multiple instructions past a terminator.
* We have to take thoe instructions and reinsert them BEFORE the terminator of the incoming edge
*/
llvm::Instruction* incomingTerminator = incomingBlock->getTerminator();
llvm::Instruction* currentTerminator = llvmBasicBlock->getTerminator();
llvm::BasicBlock* lastBasicBlock = llvmBasicBlock;
std::vector<llvm::Instruction*> castInstructions;
llvm::Value* toNativeValue = castToNative(castedIncomingValue, tessaIncomingType, tessaPhiType);
// Make sure cast to native didn't create new basic blocks.
TessaAssert(lastBasicBlock == llvmBasicBlock);
/***
* This could happen in cases where the builtin type is different
* but they are represented in the same format by the machine
* Ala Object -> Any
*/
if (toNativeValue == castedIncomingValue) {
return castedIncomingValue;
}
/***
* Can happen if the cast to native finds two constants and pre computes the value for us
*/
if (dynamic_cast<llvm::Constant*>(toNativeValue)) {
return toNativeValue;
}
castedIncomingValue = static_cast<llvm::Instruction*>(toNativeValue);
TessaAssert(toNativeValue == (--(llvmBasicBlock->end())));
/***
* Go through the current basic block and find the instructions that were added for the cast to native
*/
while (true) {
llvm::Instruction* castInstruction = (--(llvmBasicBlock->end()));
if (castInstruction == currentTerminator) {
break;
}
castInstruction->removeFromParent();
castInstructions.push_back(castInstruction);
}
/***
* Add those instructions back into the incoming edge's basic block
*/
for (int i = castInstructions.size() - 1; i >= 0; i--) {
llvm::Instruction* castInstruction = castInstructions.at(i);
castInstruction->insertBefore(incomingTerminator);
}
}
return castedIncomingValue;
}
/***
* At this point we've already created all of the LLVM IR instructions and now finally updating phi operands.
* We also have to satisfy the LLVM type system. To do this, we have to insert the appropriate casting instructions
* right before the branch of the incoming edge.
*/
llvm::Value* LlvmIRGenerator::castPhiOperandInIncomingEdge(llvm::PHINode* phiNode, llvm::Value* llvmIncomingValue, llvm::BasicBlock* llvmIncomingBasicBlock, TessaTypes::Type* tessaPhiType, TessaTypes::Type* tessaIncomingType) {
llvm::BasicBlock* incomingBlock = llvmIncomingBasicBlock;
const llvm::Type* phiType = phiNode->getType();
llvm::Value* castedIncomingValue = llvmIncomingValue;
castedIncomingValue = insertCastInIncomingBlock(castedIncomingValue, incomingBlock, tessaPhiType, tessaIncomingType);
castedIncomingValue = castUndefinedOperandInIncomingEdge(castedIncomingValue, incomingBlock->getTerminator(), tessaPhiType);
/***
* Finally, if the phi represents a pointer, we have to cast the incoming operand pointer to the generic pointer type.
*/
if (phiType->isPointerTy()) {
const llvm::Type* operandType = castedIncomingValue->getType();
TessaAssert(operandType->isPointerTy());
if (phiType != operandType) {
castedIncomingValue = llvm::BitCastInst::Create(llvm::Instruction::BitCast, castedIncomingValue, phiType, "", incomingBlock->getTerminator());
}
}
return castedIncomingValue;
}
/***
* Create the phi for now. For loops, we have to add the incoming values AFTER
* we go through the loop body
*/
void LlvmIRGenerator::addLlvmPhiValues(List<TessaVM::BasicBlock*, avmplus::LIST_GCObjects>* basicBlocks) {
debugMessage("Adding LLVM Phi Values");
for (uint32_t i = 0; i < basicBlocks->size(); i++) {
TessaVM::BasicBlock* basicBlock = basicBlocks->get(i);
List<TessaInstructions::PhiInstruction*, avmplus::LIST_GCObjects>* phiInstructions = basicBlock->getPhiInstructions();
//basicBlock->printResults();
for (uint32_t phiIndex = 0; phiIndex < phiInstructions->size(); phiIndex++) {
TessaInstructions::PhiInstruction* phiInstruction = phiInstructions->get(phiIndex);
TessaTypes::Type* phiType = phiInstruction->getType();
llvm::PHINode* llvmPhi = (llvm::PHINode*) getValue(phiInstruction);
int numberOfOperands = phiInstruction->numberOfOperands();
//phiInstruction->print();
for (int phiOperandIndex = 0; phiOperandIndex < numberOfOperands; phiOperandIndex++) {
TessaVM::BasicBlock* incomingBlock = phiInstruction->getIncomingEdge(phiOperandIndex);
TessaInstruction* tessaIncomingValue = phiInstruction->getOperand(incomingBlock)->resolve();
TessaTypes::Type* incomingType = tessaIncomingValue->getType();
llvm::Value* llvmIncomingValue = getValue(tessaIncomingValue);
llvm::BasicBlock* llvmIncomingBlock = _tessaToEndLlvmBasicBlockMap->get(incomingBlock);
llvmIncomingValue = castPhiOperandInIncomingEdge(llvmPhi, llvmIncomingValue, llvmIncomingBlock, phiType, incomingType);
// llvmIncomingBlock->dump();
// Could be another instruction that creates another basic block.
/*
if (llvm::Instruction* castedInstruction = dynamic_cast<llvm::Instruction*>(llvmIncomingValue)) {
llvmIncomingBlock = castedInstruction->getParent();
}
*/
llvmPhi->addIncoming(llvmIncomingValue, llvmIncomingBlock);
} // End adding phi operands
} // end finding phi instructions in basic block
} // End basic block
}
void LlvmIRGenerator::visit(PhiInstruction* phiInstruction) {
const llvm::Type* typeOfPhi = this->getLlvmType(phiInstruction->getType());
llvm::PHINode* llvmPhi = llvm::PHINode::Create(typeOfPhi, "", llvmBasicBlock);
int numberOfOperands = phiInstruction->numberOfOperands();
llvmPhi->reserveOperandSpace((uint32_t)numberOfOperands);
putValue(phiInstruction, llvmPhi);
}
void LlvmIRGenerator::visit(ParameterInstruction* parameterInstruction) {
// Parameter Instructions should already have been mapped to something
TessaInstruction* resolvedInstruction = parameterInstruction->resolve();
if (resolvedInstruction != parameterInstruction) {
putValue(parameterInstruction, getValue(resolvedInstruction));
} else {
if (currentBasicBlock->getBasicBlockId() != 0) {
/***
* When we inline a method, local variables that are not parameters
* will point to themselves. Those parameter instructions are "initialized" to undefined,
* which then get set to their default value later in the instruction stream.
* If this is the first basic block of a method, the parameter instruction should be mapped
* to a value already
*/
putValue(parameterInstruction, _undefinedAtom);
} else {
AvmAssert(containsLlvmValue(parameterInstruction));
}
}
}
void LlvmIRGenerator::visit(CoerceInstruction* coerceInstruction) {
TessaTypes::Type* typeToConvert = coerceInstruction->getType();
TessaInstruction* instructionToCoerce = coerceInstruction->getInstructionToCoerce()->resolve();
TessaTypes::Type* originalType = instructionToCoerce->getType();
llvm::Value* instructionValue = getValue(instructionToCoerce);
llvm::Value* coercedType;
if (coerceInstruction->useCoerceObjAtom) {
instructionValue = nativeToAtom(instructionValue, originalType);
TessaAssert(isAtomType(instructionValue));
TessaAssert(isLlvmPointerType(typeToConvert));
createLlvmCallInstruction(GET_LLVM_CALLINFO(CoerceObject_Atom), 3, _envPointer, instructionValue, createConstantPtr((intptr_t)(coerceInstruction->resultTraits)));
coercedType = AtomToScriptObject(instructionValue);
} else if (hasType(instructionToCoerce)) {
coercedType = castToNative(instructionValue, originalType, typeToConvert);
} else {
// Means we have an atom
coercedType = atomToNative(instructionValue, typeToConvert);
}
putValue(coerceInstruction, coercedType);
}
void LlvmIRGenerator::visit(ConvertInstruction* convertInstruction) {
TessaTypes::Type* typeToConvert = convertInstruction->getType();
TessaInstruction* instructionToCoerce = convertInstruction->getInstructionToCoerce()->resolve();
TessaTypes::Type* originalType = instructionToCoerce->getType();
llvm::Value* instructionValue = getValue(instructionToCoerce);
llvm::Value* convertedType;
if (hasType(instructionToCoerce)) {
convertedType = castToNative(instructionValue, originalType, typeToConvert);
} else {
convertedType = atomToNative(instructionValue, typeToConvert);
}
TessaAssert(convertedType != NULL);
putValue(convertInstruction, convertedType);
}
bool LlvmIRGenerator::isArrayElementAccess(TessaInstruction* receiverObject, TessaInstruction* key) {
TessaTypes::Type* receiverType = receiverObject->getType();
if (receiverType == _tessaTypeFactory->anyArrayType()) {
if (key != NULL) {
TessaTypes::Type* keyType = key->getType();
return (keyType->isNumber()) || (keyType->isInteger());
}
}
return false;
}
/***
* We can't use the TESSA type system yet because vector object type
*/
bool LlvmIRGenerator::isArrayOrObjectType(TessaTypes::Type* tessaType, Traits* objectTraits) {
if (tessaType->isArray() || tessaType->isVector()) {
if (tessaType->isVector()) {
TessaTypes::VectorType* vectorType = reinterpret_cast<TessaTypes::VectorType*>(tessaType);
return vectorType->getElementType()->isObject();
} else {
return true;
}
}
return false;
}
bool LlvmIRGenerator::isIntOrUIntVector(TessaTypes::Type* objectType, Traits* objectTraits) {
if (objectType->isVector()) {
TessaTypes::VectorType* vectorType = reinterpret_cast<TessaTypes::VectorType*>(objectType);
TessaTypes::Type* elementType = vectorType->getElementType();
return elementType->isInteger() || elementType->isUnsignedInt();
}
return false;
}
llvm::Value* LlvmIRGenerator::getArrayOrVectorObjectIntegerIndex(GetPropertyInstruction* getPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmIndex, bool isUnsignedInteger) {
TessaTypes::Type* resultType = getPropertyInstruction->getType();
TessaTypes::Type* objectType = getPropertyInstruction->getReceiverInstruction()->resolve()->getType();
TessaTypes::Type* indextype = getPropertyInstruction->getPropertyKey()->resolve()->getType();
llvm::Value* result;
Traits* objectTraits = getPropertyInstruction->objectTraits;
AvmAssert(indextype->isInteger() || indextype->isUnsignedInt() || indextype->isNumber());
const LlvmCallInfo* llvmCallInfo;
if (objectType == _tessaTypeFactory->anyArrayType()) {
if (isUnsignedInteger) {
llvmCallInfo = GET_LLVM_CALLINFO(ArrayObjectGetUintProperty);
} else {
llvmCallInfo = GET_LLVM_CALLINFO(ArrayObjectGetIntProperty);
}
} else {
AvmAssert(objectType->isVector());
if (isUnsignedInteger) {
TessaAssert(false);
llvmCallInfo = GET_LLVM_CALLINFO(ObjectVectorObject_GetIntProperty);
} else {
llvmCallInfo = GET_LLVM_CALLINFO(ObjectVectorObject_GetIntProperty);
}
}
result = createLlvmCallInstruction(llvmCallInfo, 2, receiverObject, llvmIndex);
return atomToNative(result, resultType);
}
llvm::Value* LlvmIRGenerator::getIntegerVectorPropertyInline(GetPropertyInstruction* getPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmIndex, bool isUnsignedInteger) {
llvm::BasicBlock* integerVectorErrorBasicBlock = llvm::BasicBlock::Create(*context, "GetVectorIntError", _llvmFunction);
llvm::BasicBlock* integerVectorFastBlock = llvm::BasicBlock::Create(*context, "GetVectorIntFast", _llvmFunction);
llvm::BasicBlock* mergeBlock = llvm::BasicBlock::Create(*context, "GetVectorIntMerge", _llvmFunction);
/***
* generate LLVM IR for "if (index <= IntVectorObject::m_length)"
*/
llvm::Value* arrayLength = createLlvmLoad(receiverObject, offsetof(IntVectorObject, m_length) / sizeof(int32_t));
llvm::Value* isIndexValid = new llvm::ICmpInst(*llvmBasicBlock, llvm::CmpInst::ICMP_SLE, llvmIndex, arrayLength, "");
llvm::Value* branchToFastPath = llvm::BranchInst::Create(integerVectorFastBlock, integerVectorErrorBasicBlock, isIndexValid, llvmBasicBlock);
/***
* generate LLVM IR for "IntVectorObject::m_array[llvmIndex]"
*/
this->llvmBasicBlock = integerVectorFastBlock;
llvm::Value* rawPointer = createLlvmLoad(receiverObject, offsetof(IntVectorObject, m_array) / sizeof(int32_t));
llvm::Value* arrayOffset = llvm::BinaryOperator::Create(llvm::BinaryOperator::Shl, llvmIndex, createConstantInt(2), "", llvmBasicBlock);
llvm::Value* arrayAddress = llvm::BinaryOperator::Create(llvm::BinaryOperator::Add, rawPointer, arrayOffset, "", llvmBasicBlock);
llvm::Value* arrayAddressPointer = castIntToPtr(arrayAddress, "vector int pointer");
llvm::Value* loadedIntegerVectorProperty = createLlvmLoad(arrayAddressPointer, 0);
llvm::BranchInst::Create(mergeBlock, llvmBasicBlock);
/***
* Fill out the error block
*/
this->llvmBasicBlock = integerVectorErrorBasicBlock;
llvm::Value* slowPathLoadedIntVectorProperty = getIntegerVectorPropertyCall(getPropertyInstruction, receiverObject, llvmIndex, isUnsignedInteger);
llvm::BranchInst::Create(mergeBlock, llvmBasicBlock);
/***
* Merge block. Model the resulting vector element as a phi
*/
this->llvmBasicBlock = mergeBlock;
llvm::PHINode* getIntProperty = llvm::PHINode::Create(_intType, "GetIntVector", llvmBasicBlock);
getIntProperty->addIncoming(loadedIntegerVectorProperty, integerVectorFastBlock);
getIntProperty->addIncoming(slowPathLoadedIntVectorProperty, integerVectorErrorBasicBlock);
return getIntProperty;
//return getIntegerVectorPropertyCall(getPropertyInstruction, receiverObject, llvmIndex, isUnsignedInteger);
}
llvm::Value* LlvmIRGenerator::getIntegerVectorPropertyCall(GetPropertyInstruction* getPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmIndex, bool isUnsignedInteger) {
const LlvmCallInfo* llvmCallInfo;
Traits* objectTraits = getPropertyInstruction->objectTraits;
TessaTypes::Type* objectType = getPropertyInstruction->objectType;
if (objectType == _tessaTypeFactory->intVectorType()) {
TessaAssert(objectTraits == VECTORINT_TYPE);
if (isUnsignedInteger) {
llvmCallInfo = GET_LLVM_CALLINFO(IntVectorObject_GetNativeUIntProperty);
} else {
llvmCallInfo = GET_LLVM_CALLINFO(IntVectorObject_GetNativeIntProperty);
}
} else {
if (isUnsignedInteger) {
llvmCallInfo = GET_LLVM_CALLINFO(UIntVectorObject_GetNativeUIntProperty);
} else {
llvmCallInfo = GET_LLVM_CALLINFO(UIntVectorObject_GetNativeIntProperty);
}
}
TessaAssert(receiverObject->getType()->isPointerTy());
return createLlvmCallInstruction(llvmCallInfo, 2, receiverObject, llvmIndex);
}
llvm::Value* LlvmIRGenerator::getIntegerVectorProperty(GetPropertyInstruction* getPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmIndex, bool isUnsignedInteger) {
Traits* objectTraits = getPropertyInstruction->objectTraits;
Traits* resultTraits = getPropertyInstruction->resultTraits;
TessaTypes::Type* resultType = getPropertyInstruction->getType();
TessaTypes::Type* objectType = getPropertyInstruction->getReceiverInstruction()->resolve()->getType();
TessaTypes::Type* keyType = getPropertyInstruction->getPropertyKey()->getType();
if ((resultType == _tessaTypeFactory->integerType()) || (resultType == _tessaTypeFactory->uintType())) {
//TessaAssert((resultTraits == INT_TYPE) || (resultTraits == UINT_TYPE));
llvmIndex = castToNative(llvmIndex, keyType, _tessaTypeFactory->integerType());
return getIntegerVectorPropertyInline(getPropertyInstruction, receiverObject, llvmIndex, isUnsignedInteger);
} else {
TessaAssert(false);
return NULL;
}
}
llvm::Value* LlvmIRGenerator::getDoubleVectorProperty(GetPropertyInstruction* getPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmIndex, bool isUnsignedInteger) {
Traits* resultTraits = getPropertyInstruction->resultTraits;
TessaTypes::Type* resultType = getPropertyInstruction->getType();
if (resultType == _tessaTypeFactory->numberType()) {
//TessaAssert(resultTraits == NUMBER_TYPE);
const LlvmCallInfo* llvmCallInfo;
if (isUnsignedInteger) {
llvmCallInfo = GET_LLVM_CALLINFO(DoubleVectorObject_GetNativeUIntProperty);
} else {
llvmCallInfo = GET_LLVM_CALLINFO(DoubleVectorObject_GetNativeIntProperty);
}
return createLlvmCallInstruction(llvmCallInfo, 2, receiverObject, llvmIndex);
} else {
TessaAssert(false);
return NULL;
}
}
llvm::Value* LlvmIRGenerator::getLateBoundIntegerProperty(GetPropertyInstruction* getPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmIndex, bool isUnsignedInteger) {
TessaTypes::Type* resultType = getPropertyInstruction->getType();
TessaInstruction* tessaReceiver = getPropertyInstruction->getReceiverInstruction()->resolve();
if (tessaReceiver->getType()->isPointer()) {
AvmAssert(isPointerType(receiverObject));
receiverObject = nativeToAtom(receiverObject, tessaReceiver->getType());
}
TessaAssert(isAtomType(receiverObject));
const LlvmCallInfo* llvmCallInfo;
if (isUnsignedInteger) {
llvmCallInfo = GET_LLVM_CALLINFO(MethodEnvGetPropertyLateUnsignedInteger);
} else {
llvmCallInfo = GET_LLVM_CALLINFO(MethodEnvGetPropertyLateInteger);
}
llvm::Value* result = createLlvmCallInstruction(llvmCallInfo, 3, _envPointer, receiverObject, llvmIndex);
return atomToNative(result, resultType);
}
llvm::Value* LlvmIRGenerator::earlyBindGetIntegerIndexResult(GetPropertyInstruction* getPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmIndex, bool isUnsignedInteger) {
TessaTypes::Type* resultType = getPropertyInstruction->getType();
TessaTypes::Type* objectType = getPropertyInstruction->getReceiverInstruction()->resolve()->getType();
TessaTypes::Type* indextype = getPropertyInstruction->getPropertyKey()->getType();
Traits* objectTraits = getPropertyInstruction->objectTraits;
if (isArrayOrObjectType(objectType, objectTraits)) {
TessaAssert(receiverObject->getType()->isPointerTy());
TessaAssert(isAtomType(llvmIndex));
AvmAssert(indextype->isInteger() || indextype->isUnsignedInt() || indextype->isNumber());
AvmAssert(objectType->isArray() || objectType->isScriptObject());
return getArrayOrVectorObjectIntegerIndex(getPropertyInstruction, receiverObject, llvmIndex, isUnsignedInteger);
} else if (isIntOrUIntVector(objectType, objectTraits)) {
//TessaAssert ((objectTraits == VECTORINT_TYPE) || (objectTraits == VECTORUINT_TYPE));
return getIntegerVectorProperty(getPropertyInstruction, receiverObject, llvmIndex, isUnsignedInteger);
} else if (objectType == _tessaTypeFactory->numberVectorType()) {
//TessaAssert(objectTraits == VECTORDOUBLE_TYPE);
return getDoubleVectorProperty(getPropertyInstruction, receiverObject, llvmIndex, isUnsignedInteger);
} else {
return getLateBoundIntegerProperty(getPropertyInstruction, receiverObject, llvmIndex, isUnsignedInteger);
}
}
llvm::Value* LlvmIRGenerator::callGetCacheHandler(GetPropertyInstruction* getPropertyInstruction, llvm::Value* receiverObjectAtom) {
TessaAssert(receiverObjectAtom->getType()->isIntegerTy()); // Receiver object has to be boxed into an atom
GetCache* cacheSlot = getPropertyInstruction->getCacheSlot;
TessaAssert(cacheSlot != NULL);
// Call with this signature: Atom getprop_miss(GetCache& c, MethodEnv* env, Atom obj)
llvm::Value* cacheAddress = createConstantPtr((intptr_t) cacheSlot);
llvm::Value* cacheHandler = createLlvmLoadPtr(cacheAddress, getPropertyInstruction->getCacheGetHandlerOffset / sizeof(int32_t));
const llvm::FunctionType* getCacheFunctionType = getGetCacheHandlerFunctionType();
int argCount = 3;
return createLlvmIndirectCallInstruction(cacheHandler, getCacheFunctionType, "GetPropertyCache", argCount,
cacheAddress, _envPointer, receiverObjectAtom);
}
llvm::Value* LlvmIRGenerator::emitGetPropertySlow(GetPropertyInstruction* getPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmKey, llvm::Value* llvmPropertyName) {
TessaTypes::Type* resultType = getPropertyInstruction->getType();
TessaTypes::Type* receiverType = getPropertyInstruction->getReceiverInstruction()->getType();
receiverObject = nativeToAtom(receiverObject, receiverType);
llvm::Value* result;
if (getPropertyInstruction->usePropertyCache) {
result = callGetCacheHandler(getPropertyInstruction, receiverObject);
} else {
// We're super lost
TessaInstruction* tessaKey = getPropertyInstruction->getPropertyKey();
llvmKey = nativeToAtom(llvmKey, tessaKey->getType());
result = createLlvmCallInstruction(GET_LLVM_CALLINFO(ToplevelGetProperty), 4, _toplevelPointer, receiverObject, llvmKey, llvmPropertyName);
}
return atomToNative(result, resultType);
}
llvm::Value* LlvmIRGenerator::earlyBindGetPropertyWithMultiname(GetPropertyInstruction* getPropertyInstruction, llvm::Value* receiverObjectAtom, llvm::Value* llvmKeyAtom, TessaTypes::Type* resultType) {
const Multiname* propertyName = getPropertyInstruction->getPropertyMultiname();
llvm::Value* llvmPropertyName = createConstantPtr((intptr_t)propertyName);
TessaAssert(isAtomType(receiverObjectAtom));
TessaAssert(isAtomType(llvmKeyAtom));
llvm::Value* result = createLlvmCallInstruction(GET_LLVM_CALLINFO(GetPropertyIndex), 4, _envPointer, receiverObjectAtom, llvmPropertyName, llvmKeyAtom);
return atomToNative(result, resultType);
}
/***
* This is mostly a copy of emit(OP_getproperty) attemps to early bind. This is horrific, and should later be cleaned out
* with real TESSA types. For now, we need it because the performance improvements are too good.
*/
llvm::Value* LlvmIRGenerator::earlyBindGetProperty(GetPropertyInstruction* getPropertyInstruction, llvm::Value* llvmPropertyName, llvm::Value* receiverObject, llvm::Value* llvmKey) {
TessaInstruction* tessaReceiverObject = getPropertyInstruction->getReceiverInstruction();
TessaTypes::Type* receiverType = tessaReceiverObject->resolve()->getType();
TessaTypes::Type* resultType = getPropertyInstruction->getType();
TessaTypes::Type* indexType = _tessaTypeFactory->anyType();
TessaValue* propertyKey = getPropertyInstruction->getPropertyKey();
if (propertyKey != NULL) {
indexType = propertyKey->getType();
}
Traits* indexTraits = getPropertyInstruction->getIndexTraits();
Traits* objectTraits = getPropertyInstruction->objectTraits;
Traits* resultTraits = getPropertyInstruction->resultTraits;
const Multiname* propertyName = getPropertyInstruction->getPropertyMultiname();
bool attribute = propertyName->isAttr();
bool maybeIntegerIndex = !attribute && propertyName->isRtname() && propertyName->containsAnyPublicNamespace();
llvm::Value* result;
if ((maybeIntegerIndex && (indexTraits == INT_TYPE)) || (indexType->isInteger())) {
bool isUnsignedInteger = false;
if (indexType->isNumber()) {
AvmAssert(llvmKey->getType() == _doubleType);
llvmKey = castFloatToNative(llvmKey, _tessaTypeFactory->integerType());
}
AvmAssert(llvmKey->getType()->isIntegerTy());
result = earlyBindGetIntegerIndexResult(getPropertyInstruction, receiverObject, llvmKey, isUnsignedInteger);
} else if ((maybeIntegerIndex && (indexTraits == UINT_TYPE)) || (indexType->isUnsignedInt())) {
bool isUnsignedInteger = true;
result = earlyBindGetIntegerIndexResult(getPropertyInstruction, receiverObject, llvmKey, isUnsignedInteger);
} else if (maybeIntegerIndex && (indexTraits != STRING_TYPE)) {
TessaInstruction* tessaKey = getPropertyInstruction->getPropertyKey();
receiverObject = nativeToAtom(receiverObject, receiverType);
llvmKey = nativeToAtom(llvmKey, tessaKey->getType());
result = earlyBindGetPropertyWithMultiname(getPropertyInstruction, receiverObject, llvmKey, resultType);
} else {
result = emitGetPropertySlow(getPropertyInstruction, receiverObject, llvmKey, llvmPropertyName);
}
TessaAssert(result != NULL);
return result;
}
void LlvmIRGenerator::visit(GetPropertyInstruction* getPropertyInstruction) {
const Multiname* propertyName = getPropertyInstruction->getPropertyMultiname();
llvm::Value* llvmPropertyName = createConstantPtr((intptr_t)propertyName);
TessaInstruction* receiverInstruction = getPropertyInstruction->getReceiverInstruction();
TessaTypes::Type* receiverType = receiverInstruction->getType();
llvm::Value* receiverObject = getValue(receiverInstruction);
llvm::Value* result;
TessaInstruction* key = getPropertyInstruction->getPropertyKey();
llvm::Value* llvmKey = _nullObjectAtom;
if (key != NULL) {
llvmKey = getValue(key);
}
result = earlyBindGetProperty(getPropertyInstruction, llvmPropertyName, receiverObject, llvmKey);
TessaAssert(result != NULL);
putValue(getPropertyInstruction, result);
}
void LlvmIRGenerator::emitSetPropertySlow(SetPropertyInstruction* setPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmKey, llvm::Value* valueToSet, llvm::Value* llvmPropertyName) {
TessaTypes::Type* receiverType = setPropertyInstruction->getReceiverInstruction()->resolve()->getType();
TessaTypes::Type* valueType = setPropertyInstruction->getValueToSet()->resolve()->getType();
receiverObject = nativeToAtom(receiverObject, receiverType);
if (setPropertyInstruction->usePropertyCache) {
// Give up, we have no idea what kind of property we are getting, so just use the cache
valueToSet = nativeToAtom(valueToSet, valueType);
callSetCacheHandler(setPropertyInstruction, receiverObject, valueToSet);
} else {
if (setPropertyInstruction->isInitProperty()) {
AvmAssert(false);
} else {
// Super duper lost
TessaAssert(false);
TessaTypes::Type* keyType = setPropertyInstruction->getPropertyKey()->getType();
llvmKey = nativeToAtom(llvmKey, keyType);
valueToSet = nativeToAtom(valueToSet, valueType);
createLlvmCallInstruction(GET_LLVM_CALLINFO(ToplevelSetProperty), 5, _toplevelPointer, receiverObject, valueToSet, llvmKey, llvmPropertyName);
}
}
}
void LlvmIRGenerator::earlyBindSetIntegerIndexResult(SetPropertyInstruction* setPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmIndex, llvm::Value* valueToSet, bool isUnsignedInteger) {
TessaTypes::Type* resultType = setPropertyInstruction->getType();
TessaTypes::Type* objectType = setPropertyInstruction->getReceiverInstruction()->resolve()->getType();
Traits* objectTraits = setPropertyInstruction->objectTraits;
if (isArrayOrObjectType(objectType, objectTraits)) {
TessaAssert(receiverObject->getType()->isPointerTy());
(isAtomType(llvmIndex));
TessaTypes::Type* indexType = setPropertyInstruction->getPropertyKey()->resolve()->getType();
AvmAssert(indexType->isInteger() || indexType->isUnsignedInt() || indexType->isNumber());
AvmAssert(objectType->isArray() || objectType->isScriptObject());
return setArrayOrVectorObjectIntegerIndex(setPropertyInstruction, receiverObject, llvmIndex, valueToSet, isUnsignedInteger);
} else if (isIntOrUIntVector(objectType, objectTraits)) {
//TessaAssert ((objectTraits == VECTORINT_TYPE) || (objectTraits == VECTORUINT_TYPE));
TessaTypes::Type* indexType = setPropertyInstruction->getPropertyKey()->getType();
AvmAssert(indexType->isInteger() || indexType->isUnsignedInt() || indexType->isNumber());
return setIntegerVectorProperty(setPropertyInstruction, receiverObject, llvmIndex, valueToSet, isUnsignedInteger);
} else if (objectType == _tessaTypeFactory->numberVectorType()) {
//TessaAssert(objectTraits == VECTORDOUBLE_TYPE);
return setDoubleVectorProperty(setPropertyInstruction, receiverObject, llvmIndex, valueToSet, isUnsignedInteger);
} else {
return setLateBoundIntegerProperty(setPropertyInstruction, receiverObject, llvmIndex, valueToSet, isUnsignedInteger);
}
}
void LlvmIRGenerator::setPropertyWithMultiname(SetPropertyInstruction* setPropertyInstruction, llvm::Value* receiverObjectAtom, llvm::Value* indexAtom, llvm::Value* valueToSetAtom) {
const Multiname* propertyName = setPropertyInstruction->getPropertyName();
llvm::Value* multinameConstant = createConstantPtr((intptr_t)propertyName); // precomputed multiname
TessaAssert(isAtomType(receiverObjectAtom));
TessaAssert(isAtomType(valueToSetAtom));
TessaAssert(isAtomType(indexAtom));
createLlvmCallInstruction(GET_LLVM_CALLINFO(SetPropertyIndex), 5, _envPointer, receiverObjectAtom, multinameConstant, valueToSetAtom, indexAtom);
}
/***
* The early binding semantics are WTF crazy
*/
void LlvmIRGenerator::earlyBindSetProperty(SetPropertyInstruction* setPropertyInstruction, llvm::Value* llvmPropertyName, llvm::Value* receiverObject, llvm::Value* llvmKey, llvm::Value* valueToSet) {
const Multiname* propertyName = setPropertyInstruction->getPropertyName();
bool attr = propertyName->isAttr();
bool indexMaybeInteger = !attr && (propertyName->isRtname()) && propertyName->containsAnyPublicNamespace();
Traits* indexTraits = setPropertyInstruction->getIndexTraits();
Traits* objectTraits = setPropertyInstruction->objectTraits;
Traits* valueTraits = setPropertyInstruction->valueTraits;
TessaTypes::Type* indexType = _tessaTypeFactory->anyType();
TessaValue* propertyKey = setPropertyInstruction->getPropertyKey();
if (propertyKey != NULL) {
indexType = propertyKey->getType();
}
TessaTypes::Type* valueType = setPropertyInstruction->getValueToSet()->getType();
TessaTypes::Type* receiverType = setPropertyInstruction->getReceiverInstruction()->resolve()->getType();
if ((indexMaybeInteger && (indexTraits == INT_TYPE)) || (indexType->isInteger())) {
bool isUnsignedInteger = false;
if (indexType->isNumber()) {
AvmAssert(llvmKey->getType() == _doubleType);
llvmKey = castFloatToNative(llvmKey, _tessaTypeFactory->integerType());
}
AvmAssert(isAtomType(llvmKey));
earlyBindSetIntegerIndexResult(setPropertyInstruction, receiverObject, llvmKey, valueToSet, isUnsignedInteger);
} else if (indexMaybeInteger && (indexTraits == UINT_TYPE)) {
TessaAssert(indexMaybeInteger && (indexTraits == UINT_TYPE));
TessaAssert(indexType->isInteger() || indexType->isUnsignedInt());
bool isUnsignedInteger = true;
earlyBindSetIntegerIndexResult(setPropertyInstruction, receiverObject, llvmKey, valueToSet, isUnsignedInteger);
} else if (indexMaybeInteger) {
TessaTypes::Type* keyType = setPropertyInstruction->getPropertyKey()->getType();
receiverObject = nativeToAtom(receiverObject, receiverType);
llvmKey = nativeToAtom(llvmKey, keyType);
valueToSet = nativeToAtom(valueToSet, valueType);
setPropertyWithMultiname(setPropertyInstruction, receiverObject, llvmKey, valueToSet);
} else {
emitSetPropertySlow(setPropertyInstruction, receiverObject, llvmKey, valueToSet, llvmPropertyName);
} // end else
} // end WTF
/**
* The object we are setting the property on is either an array or vector.<Object> type.
* The "property name" is an integer, hence llvmIndex.
* The value to set can be anything.
*/
void LlvmIRGenerator::setArrayOrVectorObjectIntegerIndex(SetPropertyInstruction* setPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmIndex, llvm::Value* valueToSet, bool isUnsignedInteger) {
TessaTypes::Type* valueType = setPropertyInstruction->getValueToSet()->resolve()->getType();
valueToSet = nativeToAtom(valueToSet, valueType);
TessaAssert(receiverObject->getType()->isPointerTy());
TessaAssert(isAtomType(llvmIndex));
TessaTypes::Type* indexType = setPropertyInstruction->getPropertyKey()->resolve()->getType();
Traits* objectTraits = setPropertyInstruction->objectTraits;
TessaTypes::Type* objectType = setPropertyInstruction->getReceiverInstruction()->resolve()->getType();
const LlvmCallInfo* llvmCallInfo;
if (objectType == _tessaTypeFactory->anyArrayType()) {
AvmAssert(indexType->isInteger() || indexType->isUnsignedInt() || indexType->isNumber());
//TessaAssert(objectTraits == ARRAY_TYPE);
if (isUnsignedInteger) {
llvmCallInfo = GET_LLVM_CALLINFO(ArrayObjectSetUintProperty);
} else {
llvmCallInfo = GET_LLVM_CALLINFO(ArrayObjectSetIntProperty);
}
} else {
if (isUnsignedInteger) {
TessaAssert(false);
llvmCallInfo = GET_LLVM_CALLINFO(ObjectVectorObject_SetIntProperty);
} else {
AvmAssert(indexType->isInteger());
llvmCallInfo = GET_LLVM_CALLINFO(ObjectVectorObject_SetIntProperty);
}
}
createLlvmCallInstruction(llvmCallInfo, 3, receiverObject, llvmIndex, valueToSet);
}
void LlvmIRGenerator::setIntegerVectorPropertyInline(SetPropertyInstruction* setPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmIndex, llvm::Value* valueToSet, bool isUnsignedInteger) {
llvm::BasicBlock* integerVectorErrorBasicBlock = llvm::BasicBlock::Create(*context, "SetVectorIntError", _llvmFunction);
llvm::BasicBlock* integerVectorFastBlock = llvm::BasicBlock::Create(*context, "SetVectorIntFast", _llvmFunction);
llvm::BasicBlock* mergeBlock = llvm::BasicBlock::Create(*context, "SetVectorIntMerge", _llvmFunction);
/***
* do if (index < IntVectorObject::m_length)
*/
llvm::Value* arrayLength = createLlvmLoad(receiverObject, offsetof(IntVectorObject, m_length) / sizeof(int32_t));
llvm::Value* isIndexValid = new llvm::ICmpInst(*llvmBasicBlock, llvm::CmpInst::ICMP_SLT, llvmIndex, arrayLength, "");
llvm::Value* branchToFastPath = llvm::BranchInst::Create(integerVectorFastBlock, integerVectorErrorBasicBlock, isIndexValid, llvmBasicBlock);
/***
* do IntVectorObject::m_array[llvmIndex] = valueToSet
*/
this->llvmBasicBlock = integerVectorFastBlock;
llvm::Value* rawPointer = createLlvmLoad(receiverObject, offsetof(IntVectorObject, m_array) / sizeof(int32_t));
llvm::Value* arrayOffset = llvm::BinaryOperator::Create(llvm::BinaryOperator::Shl, llvmIndex, createConstantInt(2), "", llvmBasicBlock);
llvm::Value* arrayAddress = llvm::BinaryOperator::Create(llvm::BinaryOperator::Add, rawPointer, arrayOffset, "", llvmBasicBlock);
llvm::Value* arrayAddressPointer = castIntToPtr(arrayAddress, "vector int pointer");
createLlvmStore(arrayAddressPointer, valueToSet, 0);
llvm::BranchInst::Create(mergeBlock, llvmBasicBlock);
/***
* Fill out the error block
*/
this->llvmBasicBlock = integerVectorErrorBasicBlock;
setIntegerVectorPropertyCall(setPropertyInstruction, receiverObject, llvmIndex, valueToSet, isUnsignedInteger);
llvm::BranchInst::Create(mergeBlock, llvmBasicBlock);
/***
* Merge
*/
this->llvmBasicBlock = mergeBlock;
//setIntegerVectorPropertyCall(setPropertyInstruction, receiverObject, llvmIndex, valueToSet, isUnsignedInteger);
}
void LlvmIRGenerator::setIntegerVectorPropertyCall(SetPropertyInstruction* setPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmIndex, llvm::Value* valueToSet, bool isUnsignedInteger) {
Traits* objectTraits = setPropertyInstruction->objectTraits;
TessaTypes::Type* keyType = setPropertyInstruction->getPropertyKey()->getType();
TessaTypes::Type* valueType = setPropertyInstruction->getValueToSet()->getType();
TessaTypes::Type* objectType = setPropertyInstruction->objectType;
const LlvmCallInfo* llvmCallInfo;
if (objectTraits == VECTORINT_TYPE) {
if (isUnsignedInteger) {
llvmCallInfo = GET_LLVM_CALLINFO(IntVectorObject_SetNativeUIntProperty);
} else {
llvmCallInfo = GET_LLVM_CALLINFO(IntVectorObject_SetNativeIntProperty);
}
} else {
TessaAssert(objectTraits != VECTORINT_TYPE);
if (isUnsignedInteger) {
llvmCallInfo = GET_LLVM_CALLINFO(UIntVectorObject_SetNativeUIntProperty);
} else {
llvmCallInfo = GET_LLVM_CALLINFO(UIntVectorObject_SetNativeIntProperty);
}
}
TessaAssert(receiverObject->getType()->isPointerTy());
createLlvmCallInstruction(llvmCallInfo, 3, receiverObject, llvmIndex, valueToSet);
}
/***
* The value we are setting is either a signed or unsigned integer.
* The object we are setting is either an integer or unsigned integer vector
* The index is either an integer or unsigned integer.
*/
void LlvmIRGenerator::setIntegerVectorProperty(SetPropertyInstruction* setPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmIndex, llvm::Value* valueToSet, bool isUnsignedInteger) {
Traits* valueTraits = setPropertyInstruction->valueTraits;
Traits* objectTraits = setPropertyInstruction->objectTraits;
TessaTypes::Type* keyType = setPropertyInstruction->getPropertyKey()->getType();
TessaTypes::Type* valueType = setPropertyInstruction->getValueToSet()->getType();
TessaTypes::Type* receiverType = setPropertyInstruction->getReceiverInstruction()->getType();
//TessaTypes::Type* objectType = setPropertyInstruction->objectType;
AvmAssert(receiverType->isVector());
AvmAssert(receiverObject->getType()->isPointerTy());
//if ((valueTraits == INT_TYPE) || (valueTraits == UINT_TYPE)) {
if (valueType->isInteger() || valueType->isUnsignedInt()) {
AvmAssert(keyType->isInteger() || keyType->isUnsignedInt() || keyType->isNumber());
/***
* Bug where keytype is number but the llvm is actually integer
*/
if (keyType->isNumber()) {
AvmAssert(isAtomType(llvmIndex));
keyType = _tessaTypeFactory->integerType();
}
valueToSet = castToNative(valueToSet, valueType, _tessaTypeFactory->integerType());
llvmIndex = castToNative(llvmIndex, keyType, _tessaTypeFactory->integerType());
setIntegerVectorPropertyInline(setPropertyInstruction, receiverObject, llvmIndex, valueToSet, isUnsignedInteger);
} else {
AvmAssert(valueType->isNumeric() || valueType->isAnyType());
AvmAssert(keyType->isNumeric());
AvmAssert(llvmIndex->getType()->isIntegerTy());
valueToSet = castToNative(valueToSet, valueType, _tessaTypeFactory->integerType());
llvmIndex = castToNative(llvmIndex, keyType, _tessaTypeFactory->integerType());
setIntegerVectorPropertyInline(setPropertyInstruction, receiverObject, llvmIndex, valueToSet, isUnsignedInteger);
//TessaAssert(false);
}
}
/***
* The object we are setting is a double vector type
* The index is an integer
* The value to set mnust be a double
*/
void LlvmIRGenerator::setDoubleVectorProperty(SetPropertyInstruction* setPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmIndex, llvm::Value* valueToSet, bool isUnsignedInteger) {
Traits* valueTraits = setPropertyInstruction->valueTraits;
TessaTypes::Type* valueType = setPropertyInstruction->getValueToSet()->getType();
TessaAssert(valueToSet->getType()->isDoubleTy());
if (valueType == _tessaTypeFactory->numberType()) {
TessaAssert(valueTraits == NUMBER_TYPE);
const LlvmCallInfo* llvmCallInfo;
if (isUnsignedInteger) {
llvmCallInfo = GET_LLVM_CALLINFO(DoubleVectorObject_SetNativeUIntProperty);
} else {
llvmCallInfo = GET_LLVM_CALLINFO(DoubleVectorObject_SetNativeIntProperty);
}
createLlvmCallInstruction(llvmCallInfo, 3, receiverObject, llvmIndex, valueToSet);
} else {
TessaAssert(false);
}
}
/***
* The index must be an integer, but the object and value to set can be anything
*/
void LlvmIRGenerator::setLateBoundIntegerProperty(SetPropertyInstruction* setPropertyInstruction, llvm::Value* receiverObject, llvm::Value* llvmIndex, llvm::Value* valueToSet, bool isUnsignedInteger) {
TessaTypes::Type* receiverType = setPropertyInstruction->getReceiverInstruction()->getType();
TessaTypes::Type* valueType = setPropertyInstruction->getValueToSet()->getType();
receiverObject = nativeToAtom(receiverObject, receiverType);
valueToSet = nativeToAtom(valueToSet, valueType);
const LlvmCallInfo* llvmCallInfo;
if (isUnsignedInteger) {
llvmCallInfo = GET_LLVM_CALLINFO(MethodEnvSetPropertyLateInteger);
} else {
llvmCallInfo = GET_LLVM_CALLINFO(MethodEnvSetPropertyLateUnsignedInteger);
}
createLlvmCallInstruction(llvmCallInfo, 4, _envPointer, receiverObject, llvmIndex, valueToSet);
}
void LlvmIRGenerator::callSetCacheHandler(SetPropertyInstruction* setPropertyInstruction, llvm::Value* receiverObjectAtom, llvm::Value* valueToSet) {
TessaAssert(receiverObjectAtom->getType()->isIntegerTy()); // Receiver object has to be boxed into an atom
TessaAssert(valueToSet->getType()->isIntegerTy()); // Receiver object has to be boxed into an atom
SetCache* cacheSlot = setPropertyInstruction->setCacheSlot;
TessaAssert(cacheSlot != NULL);
// Call void setprop_miss(SetCache& c, Atom obj, Atom val, MethodEnv* env)
llvm::Value* cacheAddress = createConstantPtr((intptr_t) cacheSlot);
llvm::Value* cacheHandler = createLlvmLoadPtr(cacheAddress, setPropertyInstruction->setCacheHandlerOffset / sizeof(int32_t));
const llvm::FunctionType* setCacheFunctionType = getSetCacheHandlerFunctionType();
int argCount = 4;
createLlvmIndirectCallInstruction(cacheHandler, setCacheFunctionType, "SetPropertyCache", argCount,
cacheAddress, receiverObjectAtom, valueToSet, _envPointer);
}
void LlvmIRGenerator::visit(SetPropertyInstruction* setPropertyInstruction) {
const Multiname* propertyName = setPropertyInstruction->getPropertyName();
llvm::Value* llvmPropertyName = createConstantPtr((intptr_t)propertyName);
TessaInstruction* key = setPropertyInstruction->getPropertyKey();
TessaInstruction* tessaValue = setPropertyInstruction->getValueToSet();
TessaTypes::Type* valueType = tessaValue->getType();
llvm::Value* valueToSet = getValue(tessaValue);
TessaInstruction* receiverInstruction = setPropertyInstruction->getReceiverInstruction();
TessaTypes::Type* receiverType = receiverInstruction->getType();
llvm::Value* receiverObject = getValue(receiverInstruction);
llvm::Value* llvmKey = _nullObjectAtom;
if (key != NULL) {
llvmKey = getValue(key);
}
earlyBindSetProperty(setPropertyInstruction, llvmPropertyName, receiverObject, llvmKey, valueToSet);
}
void LlvmIRGenerator::visit(InitPropertyInstruction* initPropertyInstruction) {
this->visit(reinterpret_cast<SetPropertyInstruction*>(initPropertyInstruction));
/*
TessaInstruction* receiverInstruction = initPropertyInstruction->getReceiverInstruction();
llvm::Value* receiverObject = getValue(receiverInstruction);
llvm::Value* receiverObjectAtom = nativeToAtom(receiverObject, receiverInstruction->getType());
llvm::Value* valueToInitializeAtom = nativeToAtom(getValue(initPropertyInstruction->getValueToInit()), initPropertyInstruction->getValueToInit()->getType());
llvm::Value* vtable = loadVTable(receiverObject, receiverInstruction->getType());
llvm::Value* multiname = initMultiname(initPropertyInstruction->getPropertyName(), initPropertyInstruction->getNamespaceInstruction());
createLlvmCallInstruction(GET_LLVM_CALLINFO(MethodEnvInitProperty), 5, _envPointer, receiverObjectAtom, multiname, valueToInitializeAtom, vtable);
*/
}
void LlvmIRGenerator::visit(GetSlotInstruction* getSlotInstruction) {
TessaInstruction* tessaReceiverObject = getSlotInstruction->getReceiverObject();
TessaTypes::Type* receiverType = tessaReceiverObject->getType();
TessaTypes::Type* slotType = getSlotInstruction->getType();
llvm::Value* receiverObject = getValue(tessaReceiverObject);
llvm::Value* receiverObjectPtr = castToNative(receiverObject, receiverType, _tessaTypeFactory->scriptObjectType());
llvm::Value* slotIndex = createConstantInt(getSlotInstruction->getSlotNumber());
llvm::Value* slotResultNative;
if (slotType == _tessaTypeFactory->numberType()) {
llvm::Value* doublePointer = createBitCast(receiverObjectPtr, _doublePointerType);
slotResultNative = createLlvmLoadDouble(doublePointer, getSlotInstruction->getSlotOffset() / sizeof(double));
} else {
slotResultNative = createLlvmLoad(receiverObjectPtr, getSlotInstruction->getSlotOffset() / sizeof(int32_t));
/***
* At this point LLVM thinks we have an integer because loads are ints.
* We have to create an llvm cast to the correct type
*/
if (slotType->isBoolean()) {
slotResultNative = castToNative(slotResultNative, _tessaTypeFactory->integerType(), _tessaTypeFactory->boolType());
} else if (slotType->isPointer()) {
slotResultNative = castIntToPtr(slotResultNative);
}
}
putValue(getSlotInstruction, slotResultNative);
}
bool LlvmIRGenerator::needsWriteBarrier(Traits* slotTraits) {
/***
* Object and string types need a write barrier
*/
return (!slotTraits || !slotTraits->isMachineType() || slotTraits== OBJECT_TYPE);
}
void LlvmIRGenerator::setSlotWithWriteBarrier(Traits* slotTraits, SetSlotInstruction* setSlotInstruction) {
llvm::Value* slotNumber = createConstantInt(setSlotInstruction->getSlotNumber());
TessaInstruction* tessaReceiverObject = setSlotInstruction->getReceiverObject()->resolve();
TessaTypes::Type* receiverType = tessaReceiverObject->resolve()->getType();
llvm::Value* receiverObject = getValue(tessaReceiverObject);
llvm::Value* gcPointer = createConstantPtr((intptr_t)core->gc);
TessaAssert(receiverType->isScriptObject());
TessaInstruction* tessaValueToSet = setSlotInstruction->getValueToSet();
TessaTypes::Type* valueType = tessaValueToSet->getType();
llvm::Value* valueToSet = getValue(tessaValueToSet);
valueToSet = castToNative(valueToSet, valueType, setSlotInstruction->getType());
llvm::Value* receiverObjectPtr = receiverObject;
llvm::Value* receiverObjectPtrInt = castPtrToInt(receiverObject);
llvm::Value* writeAddress = llvm::BinaryOperator::Create(llvm::Instruction::Add, receiverObjectPtrInt, createConstantInt(setSlotInstruction->getSlotOffset()), "", llvmBasicBlock);
writeAddress = castIntToPtr(writeAddress);
// use fast atom wb
if (slotTraits == NULL || slotTraits == OBJECT_TYPE) {
// Objects use a write barrier
TessaAssert(setSlotInstruction->isObject() || setSlotInstruction->isAny());
createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreAtomWriteBarrier), 4, gcPointer, receiverObjectPtr, writeAddress, valueToSet);
} else {
// Strings use this write barrier. Strings are represented as pure pointers in their native type Stringp*
createLlvmCallInstruction(GET_LLVM_CALLINFO(MMgcPrivateWriteBarrierRC), 4, gcPointer, receiverObjectPtr, writeAddress, valueToSet);
}
}
void LlvmIRGenerator::visit(SetSlotInstruction* setSlotInstruction) {
TessaInstruction* tessaReceiverObject = setSlotInstruction->getReceiverObject();
TessaTypes::Type* slotType = setSlotInstruction->getType();
TessaTypes::Type* receiverType = tessaReceiverObject->resolve()->getType();
llvm::Value* receiverObject = getValue(tessaReceiverObject);
if (receiverType->isAnyType()) {
receiverObject = AtomToScriptObject(receiverObject);
}
TessaAssert(receiverType->isAnyType() || receiverType->isScriptObject());
TessaInstruction* tessaValueToSet = setSlotInstruction->getValueToSet();
TessaTypes::Type* valueType = tessaValueToSet->getType();
llvm::Value* valueToSet = getValue(tessaValueToSet);
valueToSet = castToNative(valueToSet, valueType, slotType);
/***
* Base pointers in LLVM are typed. In order to correctly create a store for ActionSCript Number type
* We have to cast the base pointer to the appropriate types that can handle native string and number types.
* For ints and pointers, the standard pointer type will do.
*/
Traits* slotTraits = setSlotInstruction->getSlotTraits();
if (needsWriteBarrier(slotTraits)) {
setSlotWithWriteBarrier(slotTraits, setSlotInstruction);
} else if (slotType == _tessaTypeFactory->numberType()) {
llvm::Value* doubleReceiverPointer = createBitCast(receiverObject, _doublePointerType);
createLlvmStore(doubleReceiverPointer, valueToSet, setSlotInstruction->getSlotOffset() / sizeof(double));
} else {
if (valueType->isBoolean()) {
valueToSet = llvm::ZExtInst::Create(llvm::Instruction::ZExt, valueToSet, _intType, "", llvmBasicBlock);
}
createLlvmStore(receiverObject, valueToSet, setSlotInstruction->getSlotOffset() / sizeof(int32_t));
}
}
void LlvmIRGenerator::visit(NewArrayInstruction* newArrayInstruction) {
bool isSigned = false;
List<TessaInstruction*, LIST_GCObjects>* arrayElements = newArrayInstruction->getArrayElements();
llvm::Value* argCount = createConstantInt(newArrayInstruction->numberOfElements());
TessaAssert(newArrayInstruction->numberOfElements() <= (int)maxArgPointerSize);
for (uint32_t i = 0; i < arrayElements->size(); i++) {
TessaInstruction* arrayElement = arrayElements->get(i);
TessaTypes::Type* elementType = arrayElement->getType();
llvm::Value* atomValue = nativeToAtom(getValue(arrayElement), elementType);
atomValue = castIntToPtr(atomValue);
createLlvmStore(_allocedArgumentsPointer, atomValue, i);
}
llvm::Value* newArrayScriptObject = createLlvmCallInstruction(GET_LLVM_CALLINFO(newarray), 3, _toplevelPointer, argCount, _allocedArgumentsPointer);
llvm::Value* castArrayObjectToPointerType = createBitCast(newArrayScriptObject, _pointerType);
putValue(newArrayInstruction, castArrayObjectToPointerType);
}
void LlvmIRGenerator::visit(NextNameInstruction* nextNameInstruction) {
TessaAssert(false);
}
void LlvmIRGenerator::visit(PushScopeInstruction* pushScopeInstruction) {
TessaInstruction* tessaScopeObject = pushScopeInstruction->getScopeObject();
TessaAssert(tessaScopeObject->isObject() || tessaScopeObject->isPointer());
llvm::Value* scopeObject = getValue(tessaScopeObject);
if (tessaScopeObject->isObject()) {
TessaAssert(scopeObject->getType()->isIntegerTy());
scopeObject = castIntToPtr(scopeObject);
}
TessaAssert(scopeObject->getType()->isPointerTy());
TessaAssert(_scopeStack != NULL);
llvm::Value* scopeStackLocation = llvm::GetElementPtrInst::Create(_scopeStack, _currentScopeDepth, "PushScope", llvmBasicBlock);
new llvm::StoreInst(scopeObject, scopeStackLocation, llvmBasicBlock);
_currentScopeDepth = llvm::BinaryOperator::Create(llvm::Instruction::Add, _currentScopeDepth, createConstantInt(1), "", llvmBasicBlock);
}
void LlvmIRGenerator::visit(PopScopeInstruction* popScopeInstruction) {
TessaAssert(false);
}
llvm::Value* LlvmIRGenerator::getScopeObject(int scopeIndex) {
int offset = offsetof(ScopeChain, _scopes) + (scopeIndex * sizeof(Atom));
offset = offset / sizeof(Atom);
llvm::Value* scopeObject = createLlvmLoad(_methodEnvScopeChain, offset);
return AtomToScriptObject(scopeObject);
}
void LlvmIRGenerator::visit(GetScopeObjectInstruction* getScopeObjectInstruction) {
int32_t scopeIndex = getScopeObjectInstruction->getScopeIndex();
llvm::Value* scopeObject;
if (getScopeObjectInstruction->isOuterScope()) {
scopeObject = getScopeObject(scopeIndex);
} else {
TessaAssert(_scopeStack != NULL);
scopeObject = createLlvmLoadPtr(_scopeStack, scopeIndex);
}
TessaAssert(scopeObject != NULL);
putValue(getScopeObjectInstruction, scopeObject);
}
void LlvmIRGenerator::visit(GetGlobalScopeInstruction* getGlobalScopeInstruction) {
llvm::Value* globalScope = NULL;
const ScopeTypeChain* scope = methodInfo->declaringScope();
int captured_depth = scope->size;
globalScope = createLlvmLoadPtr(_scopeStack, 0);
if (captured_depth > 0) {
globalScope = getScopeObject(0);
} else {
globalScope = createLlvmLoadPtr(_scopeStack, 0);
}
/***
* BOth return atoms but should be script objects
*/
TessaAssert(globalScope != NULL);
putValue(getGlobalScopeInstruction, globalScope);
}
void LlvmIRGenerator::visit(WithInstruction* withInstruction) {
TessaAssert(false);
}
void LlvmIRGenerator::visit(TypeOfInstruction* typeOfInstruction) {
TessaAssert(typeOfInstruction->isLateCheck());
TessaInstruction* tessaValue = typeOfInstruction->getObjectToTest();
llvm::Value* valueToCheckAtom = nativeToAtom(getValue(tessaValue), tessaValue->getType());
TessaInstruction* tessaTypeToCompare = typeOfInstruction->getTypeToCompare();
llvm::Value* typeToCompareAtom = nativeToAtom(getValue(tessaTypeToCompare), tessaTypeToCompare->getType());
llvm::Value* traits = createLlvmCallInstruction(GET_LLVM_CALLINFO(ToplevelToClassITraits), 2, _toplevelPointer, typeToCompareAtom);
llvm::Value* result = createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreIsTypeAtom), 2, valueToCheckAtom, traits);
putValue(typeOfInstruction, result);
}
/***
* Has next 2 modifies many values at once. We have to load/store the object iterator values explicitly
* at each iteration :(
*/
void LlvmIRGenerator::visit(HasMorePropertiesInstruction* hasMorePropertiesInstruction) {
/*
HasMorePropertiesRegisterInstruction* registerIndex = hasMorePropertiesInstruction->getRegisterIndex();
llvm::Value* indexValue = getValue(registerIndex->getRegisterInstruction());
llvm::Value* indexInteger = createLlvmCallInstruction(GET_LLVM_CALLINFO(AvmCoreInteger), 1, indexValue);
llvm::Value* hasNextResult;
if (hasMorePropertiesInstruction->modifiesObject()) {
// AVM Opcode hasnext2
HasMorePropertiesObjectInstruction* hasMorePropertiesObjectInstruction = hasMorePropertiesInstruction->getObjectIndex();
TessaInstruction* objectIterator = hasMorePropertiesObjectInstruction->getObjectInstruction();
llvm::Value* object = getValue(objectIterator);
hasNextResult = env->hasnextproto(objectAtom, indexInteger) ? trueAtom : falseAtom;
putValue(hasMorePropertiesObjectInstruction, object);
} else {
// This is for AVMOpcode hasnext
TessaAssert(false);
}
// This is changed in hasNextProto
indexAtom = core->intToAtom(indexInteger);
putOperand(registerIndex, indexAtom);
putOperand(hasMorePropertiesInstruction, hasNextResult);
*/
TessaAssert(false);
}
void LlvmIRGenerator::visit(HasMorePropertiesRegisterInstruction* hasMorePropertiesIndexInstruction) {
/***
* Don't do anything for this. The hasMorePropertiesInstruction needs to set the value for this.
* Read in hasMoreProperties header file to find out. Also look at the hasnext2 AVM opcode.
*/
}
void LlvmIRGenerator::visit(HasMorePropertiesObjectInstruction* hasMorePropertiesInstruction) {
/***
* Don't do anything for this. The hasMorePropertiesInstruction needs to set the value for this.
* Read in hasMoreProperties header file to find out. Also look at the hasnext2 AVM opcode.
*/
}
void LlvmIRGenerator::visit(SwitchInstruction* switchInstruction) {
int numberOfCases = switchInstruction->numberOfCases() - 1;
TessaInstruction* switchValue = switchInstruction->getSwitchValue()->resolve();
llvm::Value* llvmSwitchValue = getValue(switchValue);
TessaAssert(switchValue->isInteger());
llvm::BasicBlock* defaultBasicBlock = getLlvmBasicBlock(switchInstruction->getDefaultCase()->getTargetBlock());
llvm::SwitchInst* llvmSwitchInstruction = llvm::SwitchInst::Create(llvmSwitchValue, defaultBasicBlock, numberOfCases, llvmBasicBlock);
for (int i = 0; i < numberOfCases; i++) {
CaseInstruction* caseInstruction = switchInstruction->getCase(i);
TessaInstruction* caseValue = caseInstruction->getCaseValue();
// llvm can only switch on constant ints.
TessaAssert(caseValue->isConstantValue());
ConstantValueInstruction* constantValue = (ConstantValueInstruction*) caseValue;
TessaTypes::ConstantInt* constantInt = (TessaTypes::ConstantInt*) (constantValue->getConstantValue());
llvm::ConstantInt* llvmCaseValue = createConstantInt(constantInt->getValue());
llvm::BasicBlock* caseBasicBlock = getLlvmBasicBlock(caseInstruction->getTargetBlock());
llvmSwitchInstruction->addCase(llvmCaseValue, caseBasicBlock);
}
putValue(switchInstruction, llvmSwitchInstruction);
}
void LlvmIRGenerator::visit(CaseInstruction* caseInstruction) {
}
void LlvmIRGenerator::visit(NewActivationInstruction* newActiviationInstruction) {
llvm::Value* newActivation = createLlvmCallInstruction(GET_LLVM_CALLINFO(MethodEnvNewActivation), 1, _envPointer);
newActivation = createBitCast(newActivation, _pointerType);
putValue(newActiviationInstruction, newActivation);
}
void LlvmIRGenerator::adjustScopeStackPointerForNewMethod(int callerScopeSize) {
llvm::Value* newScopeStack = castPtrToInt(_scopeStack);
llvm::Value* scopeAdjustment = llvm::BinaryOperator::Create(Instruction::Mul, createConstantInt(callerScopeSize), createConstantInt(sizeof(Atom)), "inline scope adjustment", llvmBasicBlock);
newScopeStack = llvm::BinaryOperator::Create(Instruction::Add, newScopeStack, scopeAdjustment, "inline begin newScopeStack", llvmBasicBlock);
newScopeStack = castIntToPtr(newScopeStack);
newScopeStack = createBitCast(newScopeStack, _scopeStack->getType());
_scopeStackCallStack->add(_scopeStack);
_scopeStackCountStack->add(_currentScopeDepth);
_scopeStack = newScopeStack;
_currentScopeDepth = createConstantInt(0);
TessaAssert(_scopeStack->getType()->isPointerTy());
}
void LlvmIRGenerator::visit(InlineBeginInstruction* inlineBeginInstruction) {
int methodId = inlineBeginInstruction->getmethodId();
LoadVirtualMethodInstruction* loadedVirualMethod = inlineBeginInstruction->getLoadedMethod();
llvm::Value* loadedMethodEnv = getValue(loadedVirualMethod->getLoadedMethodEnv());
llvm::Value* loadedMethodInfo = getValue(loadedVirualMethod->getLoadedMethodInfo());
_envPointer = loadedMethodEnv;
setMethodEnvPointers();
adjustScopeStackPointerForNewMethod(inlineBeginInstruction->_callerScopeSize);
_methodInfoStack->add(methodInfo);
this->methodInfo = inlineBeginInstruction->_inlinedMethod;
}
/***
* replicate MethodFrame ctor inline
*/
void LlvmIRGenerator::createPrologue(MethodInfo* methodInfo) {
TessaAssert(_envPointer != NULL);
int methodFrameOffset = offsetof(AvmCore, currentMethodFrame) / sizeof(int32_t); // Calculated by offsetof(AvmCore, currentMethodFrame); but not a friend class of avmcore
int envOrCodeContextOffset = offsetof(MethodFrame, envOrCodeContext) / sizeof(int32_t); // Calculated by offsetof(MethodFrame, envOrCodeContexT);
int nextOffset = offsetof(MethodFrame, next); // Calculated by offsetof(MethodFrame, next);
llvm::Value* currentMethodFrame = createLlvmLoad(_avmcorePointer, methodFrameOffset);
_methodFrame = new llvm::AllocaInst(_pointerType, createConstantInt(sizeof(MethodFrame)), "MethodFrame", llvmBasicBlock);
createLlvmStorePointer(_methodFrame, _envPointer, envOrCodeContextOffset);
createLlvmStorePointer(_methodFrame, castIntToPtr(currentMethodFrame), nextOffset);
// LLVM thinks Avmcore is a pointer to integers
createLlvmStoreInt(_avmcorePointer, currentMethodFrame, methodFrameOffset);
}
void LlvmIRGenerator::createEpilogue() {
/***
* Replicate MethodFrame dtor inline
*/
int nextOffset = offsetof(MethodFrame, next) / sizeof(int32_t); // Calculated by offsetof(MethodFrame, next);
int methodFrameOffset = offsetof(AvmCore, currentMethodFrame) / sizeof(int32_t); // Calculated by offsetof(AvmCore, currentMethodFrame); but not a friend class of avmcore
llvm::Value* nextMethodFrame = createLlvmLoad(_methodFrame, nextOffset);
createLlvmStoreInt(_avmcorePointer, nextMethodFrame, methodFrameOffset);
/*
#ifdef DEBUG
llvm::BasicBlock* lastBasicBlock = &(_llvmFunction->back());
llvm::Instruction* lastInstruction = &(lastBasicBlock->back());
lastInstruction->dump();
TessaAssert(lastInstruction->isTerminator());
llvm::Function* functionToCall = getLlvmFunction(GET_LLVM_CALLINFO(MethodEndSymbol));
std::vector<llvm::Value*> arguments;
llvm::CallInst* callInstruction = CallInst::Create(functionToCall, arguments.begin(), arguments.end(), "", lastInstruction);
#endif
*/
}
}
| [
"[email protected]"
] | [
[
[
1,
4116
]
]
] |
444cd0bffd35fd7448423e4337cf04d3ae6ef8f0 | 8c54d89af1800c4c06959a3b7b62d04f883a11c0 | /cs752/Original/Raytracer/Sphere.cpp | b3b6bb325189829b9899701630333beaea680c23 | [] | no_license | dknutsen/dokray | 567c79e7a69c80a97cd73bead151a12ad2d34f23 | 92acd2967542865963462aaf2299ab2427b89f31 | refs/heads/master | 2020-12-24T13:29:01.740250 | 2011-10-23T23:09:49 | 2011-10-23T23:09:49 | 2,639,353 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,680 | cpp |
#include "Sphere.h"
#include <iostream>
using std::cout;
Sphere::Sphere(){
material = NULL;
p = Point(0,0,0);
rad = 1.f;
}
Sphere::Sphere(Material* material, const Point& c, float radius){
this->material = material;
p = c;
rad = radius;
}
Point Sphere::c()const{ return p; }
float Sphere::r()const{ return rad; }
Point& Sphere::c(){ return p; }
float& Sphere::r(){ return rad; }
float Sphere::r2()const{ return rad*rad; }
void Sphere::preprocess(){
material->preprocess();
}
Vector Sphere::normal(const Point& point)const{
return (point-p).normal();
}
void Sphere::intersect(HitRecord& hit, const RenderContext& rc, const Ray& ray)const{
/*float a = dot(ray.d(), ray.d());
Vector v = ray.p()-p;/*Vector(ray.p().x(), ray.p().y(), ray.p().z());*/
/*float b = 2 * dot(ray.d(), v);
float c = dot(v, v) - r2();
float disc = b * b - 4 * a * c;
if (disc < 0.f){
hit.hit(std::numeric_limits<float>::infinity(), this, material);
return;
}
float distSqrt = sqrtf(disc);
float q;
if (b < 0) q = (-b - distSqrt)/2.0f;
else q = (-b + distSqrt)/2.0f;
float t0 = q / a;
float t1 = c / q;
if (t0 > t1){
float temp = t0;
t0 = t1;
t1 = temp;
}
if (t1 < 0) hit.hit(std::numeric_limits<float>::infinity(), this, material);
if (t0 < 0) hit.hit(t1, this, material);
else hit.hit(t0, this, material);*/
Vector dist = ray.p() - p;
float b = dot(dist, ray.d());
float c = dot(dist, dist) - r2();
float d = b*b - c;
float t = d > 0 ? -b - sqrt(d) : std::numeric_limits<float>::infinity();
hit.hit(t, this, this->material);
} | [
"[email protected]"
] | [
[
[
1,
66
]
]
] |
7bc40597a3b386b2a42e4752df894cb22ebf520a | 33f59b1ba6b12c2dd3080b24830331c37bba9fe2 | /Depend/Foundation/Miscellaneous/Wm4NormalCompression.cpp | 56d8c38c4ab1e2063547b7cede14ab4e5aedeed2 | [] | no_license | daleaddink/flagship3d | 4835c223fe1b6429c12e325770c14679c42ae3c6 | 6cce5b1ff7e7a2d5d0df7aa0594a70d795c7979a | refs/heads/master | 2021-01-15T16:29:12.196094 | 2009-11-01T10:18:11 | 2009-11-01T10:18:11 | 37,734,654 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,465 | cpp | // Geometric Tools, Inc.
// http://www.geometrictools.com
// Copyright (c) 1998-2006. All Rights Reserved
//
// The Wild Magic Version 4 Foundation Library source code is supplied
// under the terms of the license agreement
// http://www.geometrictools.com/License/Wm4FoundationLicense.pdf
// and may not be copied or disclosed except in accordance with the terms
// of that agreement.
#include "Wm4FoundationPCH.h"
#include "Wm4NormalCompression.h"
#include "Wm4Math.h"
using namespace Wm4;
static int gs_iN = 127; // N(N+1)/2 = 8128 < 2^{13}
static double gs_dB = 2*gs_iN+1;
static double gs_dB2 = gs_dB*gs_dB;
static double gs_dFactor = (gs_iN-1)*Mathd::Sqrt(0.5);
static double gs_dInvFactor = 1.0/gs_dFactor;
//----------------------------------------------------------------------------
void Wm4::CompressNormal (double dX, double dY, double dZ,
unsigned short& rusIndex)
{
// assert: x*x + y*y + z*z = 1
// determine octant
rusIndex = 0;
if (dX < 0.0)
{
rusIndex |= 0x8000;
dX = -dX;
}
if (dY < 0.0)
{
rusIndex |= 0x4000;
dY = -dY;
}
if (dZ < 0.0)
{
rusIndex |= 0x2000;
dZ = -dZ;
}
// determine mantissa
unsigned short usX = (unsigned short) Mathd::Floor(gs_dFactor*dX);
unsigned short usY = (unsigned short) Mathd::Floor(gs_dFactor*dY);
unsigned short usMantissa = usX + ((usY*(255-usY)) >> 1);
rusIndex |= usMantissa;
}
//----------------------------------------------------------------------------
void Wm4::UncompressNormal (unsigned short usIndex, double& rdX, double& rdY,
double& rdZ)
{
unsigned short usMantissa = usIndex & 0x1FFF;
// extract triangular indices
double dTemp = gs_dB2 - 8*usMantissa;
unsigned short usY = (unsigned short) Mathd::Floor(0.5*(gs_dB -
Mathd::Sqrt(fabs(dTemp))));
unsigned short usX = usMantissa - ((usY*(255-usY)) >> 1);
// build approximate normal
rdX = usX*gs_dInvFactor;
rdY = usY*gs_dInvFactor;
dTemp = 1.0 - rdX*rdX - rdY*rdY;
rdZ = Mathd::Sqrt(Mathd::FAbs(dTemp));
// determine octant
if (usIndex & 0x8000)
{
rdX = -rdX;
}
if (usIndex & 0x4000)
{
rdY = -rdY;
}
if (usIndex & 0x2000)
{
rdZ = -rdZ;
}
}
//----------------------------------------------------------------------------
| [
"yf.flagship@e79fdf7c-a9d8-11de-b950-3d5b5f4ea0aa"
] | [
[
[
1,
84
]
]
] |
eb7afb8c1bbab9a13517671fb3c97d596927d447 | 27c6eed99799f8398fe4c30df2088f30ae317aff | /TableViewBuddy/tag/tvb-1.0.0/tableviewbuddy.h | 9fb55b31263b913a2cb7dd201c095f9e2546e2c4 | [] | no_license | lit-uriy/ysoft | ae67cd174861e610f7e1519236e94ffb4d350249 | 6c3f077ff00c8332b162b4e82229879475fc8f97 | refs/heads/master | 2021-01-10T08:16:45.115964 | 2009-07-16T00:27:01 | 2009-07-16T00:27:01 | 51,699,806 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 403 | h | /*!
* \file tableviewbuddy.h
* \brief Интерфейс класса "TableViewBuddy".
*/
#include <QObject>
class QString;
class QTableView;
class QAction;
class TableViewBuddy: public QObject
{
Q_OBJECT
public:
TableViewBuddy(QTableView *tv);
public slots:
void slotCopy();
protected:
QString copy();
protected:
QAction *actionCopy;
QTableView *view;
};
| [
"lit-uriy@d7ba3245-3e7b-42d0-9cd4-356c8b94b330"
] | [
[
[
1,
26
]
]
] |
894994b336f18a0164073947eda2efe2f195fd2a | d76a67033e3abf492ff2f22d38fb80de804c4269 | /src/sdlmouse/love_sdlmouse.h | 43033513c30707408f5a8e84227e5b0d990837e4 | [
"Zlib"
] | permissive | truthwzl/lov8 | 869a6be317b7d963600f2f88edaefdf9b5996f2d | 579163941593bae481212148041e0db78270c21d | refs/heads/master | 2021-01-10T01:58:59.103256 | 2009-12-16T16:00:09 | 2009-12-16T16:00:09 | 36,340,451 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,665 | h | /*
* LOVE: Totally Awesome 2D Gaming.
* Website: http://love.sourceforge.net
* Licence: ZLIB/libpng
* Copyright (c) 2006-2008 LOVE Development Team
*
* This is a small interface to the mouse device
* via SDL.
*
* @author Anders Ruud
* @date 2008-03-16
*/
#ifndef LOVE_MOD_SDLMOUSE_H
#define LOVE_MOD_SDLMOUSE_H
// LOVE
#include <love/mod.h>
// Creating a separate namespace to avoid conflicts
// with standard library functions.
namespace love_sdlmouse
{
typedef struct _Mouse {
double x;
double y;
} Mouse;
// Standard module functions.
bool module_init(int argc, char ** argv, love::Core * core);
bool module_quit();
bool module_open(void * vm);
bool module_open_v8(void * vm);
/**
* Gets current mouse position on x-axis.
**/
float getX();
/**
* Gets current mouse position on x-axis.
**/
float getY();
/**
* Sets the mouse position.
**/
void setPosition(float x, float y);
/**
* Checks if a mouse button is pressed.
**/
bool isDown(int button);
/**
* Changes cursor visibility.
* @param visible True = visible, false = invisible.
**/
void setVisible(bool visible);
/**
* Returns true if the mouse is visible, false otherwise.
**/
bool isVisible();
/**
* Native function with two return values (x,y). The same
* can be achieved with separate calls to getX() and getY(),
* but getting the mouse position is common, and this
* will make the process prettier.
* Does not take any parameters, and returns two numbers.
**/
int getPosition(lua_State * L);
Mouse getPosition();
} // love_sdlmouse
#endif // LOVE_MOD_SDLMOUSE_H
| [
"m4rvin2005@8b5f54a0-8722-11de-9e21-49812d2d8162"
] | [
[
[
1,
80
]
]
] |
636d18518a80f5456c136eaa4e2cb61fdeb0c21f | 222bc22cb0330b694d2c3b0f4b866d726fd29c72 | /src/brookbox/wm2/WmlLozengeBV.inl | 62bfd2e8abb5b459f2d4913be148d3aa82dd1353 | [
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | darwin/inferno | 02acd3d05ca4c092aa4006b028a843ac04b551b1 | e87017763abae0cfe09d47987f5f6ac37c4f073d | refs/heads/master | 2021-03-12T22:15:47.889580 | 2009-04-17T13:29:39 | 2009-04-17T13:29:39 | 178,477 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 994 | inl | // Magic Software, Inc.
// http://www.magic-software.com
// http://www.wild-magic.com
// Copyright (c) 2003. All Rights Reserved
//
// The Wild Magic Library (WML) source code is supplied under the terms of
// the license agreement http://www.magic-software.com/License/WildMagic.pdf
// and may not be copied or disclosed except in accordance with the terms of
// that agreement.
//----------------------------------------------------------------------------
inline BoundingVolume::Type LozengeBV::GetType () const
{
return BV_LOZENGE;
}
//----------------------------------------------------------------------------
inline bool LozengeBV::IsValid () const
{
return m_kLozenge.Origin().X() != Mathf::MAX_REAL;
}
//----------------------------------------------------------------------------
inline void LozengeBV::Invalidate ()
{
m_kLozenge.Origin().X() = Mathf::MAX_REAL;
}
//----------------------------------------------------------------------------
| [
"[email protected]"
] | [
[
[
1,
26
]
]
] |
97e96531bc3bd2e293c0dac1135e555a6c396ff6 | 6ffa332bd047786671bf6a92d38f44aad7ec5e6c | /src/Sub-Sources/JD2D.CPP | be477f29ae4e9e5e302feb8413fa5125c8e514e5 | [] | no_license | fdalvi/library-assistant-dos | 209230390947ded99d37b80a321850063d6f08c0 | 32fec3e6a919e5126381f1118a528faff95dcd3d | refs/heads/master | 2021-01-01T17:57:20.620451 | 2009-11-07T09:30:14 | 2013-07-12T11:27:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 359 | cpp | #include<iostream.h>
#include<conio.h>
void main()
{
int y,m,d;
long int j;
cin>>j;
j=j-1721119;
y=(4*j-1)/146097;
j=4*j-1-146097*y;
d=j/4;
j=(4*d+3)/1461;
d=4*d+3-1461*j;
d=(d+4)/4;
m=(5*d-3)/153;
d=5*d-3-153*m;
d=(d+5)/5;
y=100*y+j;
if(m<10)
m=m+3;
else
{
m=m-9;
y=y+1;
}
d=d+1;
cout<<"\n\n"<<y<<" "<<m<<" "<<d;
getch();
}
| [
"[email protected]"
] | [
[
[
1,
30
]
]
] |
a5f9123af6b0f08d708c3eaef1c6e7a72210f418 | 9e4b72c504df07f6116b2016693abc1566b38310 | /stdafx.h | 508cfe77c1dfd75c47c5a89d4ba1898220438268 | [
"MIT"
] | permissive | mmeeks/rep-snapper | 73311cadd3d8753462cf87a7e279937d284714aa | 3a91de735dc74358c0bd2259891f9feac7723f14 | refs/heads/master | 2016-08-04T08:56:55.355093 | 2010-12-05T19:03:03 | 2010-12-05T19:03:03 | 704,101 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,447 | h | /* -------------------------------------------------------- *
*
* StdAfx.h
*
* Copyright 2009+ Michael Holm - www.kulitorum.com
*
* This file is part of RepSnapper and is made available under
* the terms of the GNU General Public License, version 2, or at your
* option, any later version, incorporated herein by reference.
*
* ------------------------------------------------------------------------- */
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifdef WIN32
# pragma warning( disable : 4311 4312 4244 4267 4800)
#endif
typedef unsigned int uint;
#define DEBUG_ECHO (1<<0)
#define DEBUG_INFO (1<<1)
#define DEBUG_ERRORS (1<<2)
#ifdef WIN32
#include <windows.h> // Header File For Windows
#include <tchar.h>
typedef unsigned int uint;
#endif
typedef unsigned int UINT;
#include "config.h"
#include "platform.h"
#include <stdio.h>
#include <FL/Fl.H>
#include <vmmlib/vmmlib.h>
#ifndef WIN32
// whatever this is it doesn't exist in windows and doesn't appear to be needed
# include <alloca.h>
#endif
#include "math.h" // Needed for sqrtf
#include "ArcBall.h"
// Unpleasant needs un-winding ...
using namespace std;
using namespace vmml;
// try to avoid compile time explosion by reducing includes
class GUI;
class Poly;
class GCode;
class Command;
class Point2f;
class Printer;
class Triangle;
class Segment2f;
class AsyncSerial;
class RepRapSerial;
class CuttingPlane;
class ProcessController;
class ModelViewController;
class RFO;
class RFO_File;
class RFO_Object;
class RFO_Transform3D;
struct InFillHit;
typedef unsigned int uint;
void MakeAcceleratedGCodeLine(Vector3f start, Vector3f end, float DistanceToReachFullSpeed, float extrusionFactor, GCode &code, float z, float minSpeedXY, float maxSpeedXY, float minSpeedZ, float maxSpeedZ, bool UseIncrementalEcode, bool Use3DGcode, float &E, bool EnableAcceleration);
bool IntersectXY(const Vector2f &p1, const Vector2f &p2, const Vector2f &p3, const Vector2f &p4, InFillHit &hit); // Utilityfunction for CalcInFill
bool InFillHitCompareFunc(const InFillHit& d1, const InFillHit& d2);
extern void HSVtoRGB (const float &h, const float &s, const float &v, float &r,float &g,float &b);
extern void RGBtoHSV (const float &r, const float &g, const float &b, float &h, float &s, float &v);
extern void RGBTOHSL (float red, float green, float blue, float &hue, float &sat, float &lightness);
extern void RGBTOYUV (float r, float g, float b, float &y, float &u, float &v);
extern void YUVTORGB (float y, float u, float v, float &r, float &g, float &b);
// helper for easy locking
class ToolkitLock {
public:
ToolkitLock() { Fl::lock(); }
~ToolkitLock() { Fl::unlock(); }
};
#ifdef ENABLE_LUA
extern "C" {
#include <lua.hpp>
}
#include <luabind/luabind.hpp>
using namespace luabind;
#endif // ENABLE_LUA
// extern ModelViewController *MVC;
// TODO: reference additional headers your program requires here
// ivconv
#include "ivcon.h"
| [
"repsnapper@686d4eb6-aa70-4f30-b8fa-ee57029aed71",
"mmeeks@686d4eb6-aa70-4f30-b8fa-ee57029aed71",
"michael@686d4eb6-aa70-4f30-b8fa-ee57029aed71",
"joaz@686d4eb6-aa70-4f30-b8fa-ee57029aed71",
"fcrick@686d4eb6-aa70-4f30-b8fa-ee57029aed71",
"[email protected]"
] | [
[
[
1,
22
],
[
27,
35
],
[
39,
39
],
[
41,
41
],
[
46,
47
],
[
74,
74
],
[
77,
82
],
[
84,
87
],
[
94,
94
],
[
96,
96
],
[
101,
101
],
[
104,
104
],
[
107,
107
],
[
109,
110
]
],
[
[
23,
26
],
[
37,
38
],
[
48,
73
],
[
88,
93
],
[
95,
95
],
[
97,
100
],
[
102,
103
]
],
[
[
36,
36
]
],
[
[
40,
40
],
[
75,
76
],
[
83,
83
],
[
106,
106
],
[
108,
108
]
],
[
[
42,
45
]
],
[
[
105,
105
]
]
] |
4f995114bcc43db7067140e18f21f8dbdcaf99ef | 24615db075e71b49d005aa8821a95723304148b0 | /Source/PluginEditor.h | 50724572038f50c369c0dfe769a5ebdd8a8325b5 | [] | no_license | drowaudio/Plugin_Parameter_Development | 57205838469a97b476419ec618893384ebbbe15b | c9934c1a2be5f5c47b85a55ed42069326b2c28c2 | refs/heads/master | 2021-01-01T05:53:21.046150 | 2011-11-04T23:55:56 | 2011-11-04T23:55:56 | 2,712,750 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 957 | h | /*
==============================================================================
This file was auto-generated by the Introjucer!
It contains the basic startup code for a Juce application.
==============================================================================
*/
#ifndef __PLUGINEDITOR_H_5986A5E__
#define __PLUGINEDITOR_H_5986A5E__
#include "../JuceLibraryCode/JuceHeader.h"
#include "PluginProcessor.h"
//==============================================================================
/**
*/
class PluginTestAudioProcessorEditor : public AudioProcessorEditor
{
public:
PluginTestAudioProcessorEditor (PluginTestAudioProcessor* ownerFilter);
~PluginTestAudioProcessorEditor();
//==============================================================================
// This is just a standard Juce paint method...
void paint (Graphics& g);
};
#endif // __PLUGINEDITOR_H_5986A5E__
| [
"[email protected]"
] | [
[
[
1,
33
]
]
] |
1646dd25a4067bffb43a38fb9b7dfda343906671 | cd0987589d3815de1dea8529a7705caac479e7e9 | /webkit/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h | b17c8e44b94224aa8c03d081ede9eee6c0257e22 | [] | no_license | azrul2202/WebKit-Smartphone | 0aab1ff641d74f15c0623f00c56806dbc9b59fc1 | 023d6fe819445369134dee793b69de36748e71d7 | refs/heads/master | 2021-01-15T09:24:31.288774 | 2011-07-11T11:12:44 | 2011-07-11T11:12:44 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,581 | h | /*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef InjectedBundle_h
#define InjectedBundle_h
#include "EventSendingController.h"
#include "GCController.h"
#include "LayoutTestController.h"
#include <WebKit2/WKBase.h>
#include <WebKit2/WKBundleBase.h>
#include <wtf/HashMap.h>
#include <wtf/OwnPtr.h>
#include <wtf/RefPtr.h>
#include <sstream>
namespace WTR {
class InjectedBundlePage;
class InjectedBundle {
public:
static InjectedBundle& shared();
// Initialize the InjectedBundle.
void initialize(WKBundleRef);
WKBundleRef bundle() const { return m_bundle; }
LayoutTestController* layoutTestController() { return m_layoutTestController.get(); }
GCController* gcController() { return m_gcController.get(); }
EventSendingController* eventSendingController() { return m_eventSendingController.get(); }
InjectedBundlePage* page() { return m_mainPage.get(); }
size_t pageCount() { return !!m_mainPage + m_otherPages.size(); }
void closeOtherPages();
void done();
std::ostringstream& os() { return m_outputStream; }
bool isTestRunning() { return m_state == Testing; }
private:
InjectedBundle();
~InjectedBundle();
static void _didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo);
static void _willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo);
static void _didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo);
void didCreatePage(WKBundlePageRef page);
void willDestroyPage(WKBundlePageRef page);
void didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody);
void beginTesting();
WKBundleRef m_bundle;
HashMap<WKBundlePageRef, InjectedBundlePage*> m_otherPages;
OwnPtr<InjectedBundlePage> m_mainPage;
RefPtr<LayoutTestController> m_layoutTestController;
RefPtr<GCController> m_gcController;
RefPtr<EventSendingController> m_eventSendingController;
std::ostringstream m_outputStream;
enum State {
Idle,
Testing
};
State m_state;
};
} // namespace WTR
#endif // InjectedBundle_h
| [
"[email protected]"
] | [
[
[
1,
99
]
]
] |
673c44070c52b6502f90b927b0e668bfc2bece4f | c1bcff0f1321de8a6425723cdfa0b5aa65b5c81f | /TransX/branches/3.10/mfdvarhandler.cpp | ab5a43efd799e8219cd0bfc238648c7b29b32667 | [] | no_license | net-lisias-orbiter/transx | 560266e7a4ef73ed29d9004e406fd8db28da9a43 | b9297027718a7499934a9614430aebb47422ce7f | refs/heads/master | 2023-06-27T14:16:10.697238 | 2010-09-05T01:18:54 | 2010-09-05T01:18:54 | 390,398,358 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,807 | cpp | /* Copyright (c) 2007 Duncan Sharpe, Steve Arch
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
** of this software and associated documentation files (the "Software"), to deal
** in the Software without restriction, including without limitation the rights
** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
** copies of the Software, and to permit persons to whom the Software is
** furnished to do so, subject to the following conditions:
**
** The above copyright notice and this permission notice shall be included in
** all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
** THE SOFTWARE.*/
#define STRICT
#include <windows.h>
#include <stdio.h>
#include <math.h>
#include "smartptr.h"
#include "orbitersdk.h"
#include "mfd.h"
#include "parser.h"
#include "mfdvarhandler.h"
void MFDvarhandler::addtolist(MFDvariable *item)
{
listhead.addend(item);
}
void MFDvarhandler::saveallvariables(FILEHANDLE scn)
{
char buffer[80];
class dblliter *iterator=listhead.getiterator();
class MFDvariable *pointer=static_cast<MFDvariable*>(iterator->front());
while (pointer!=NULL)
{
pointer->getname(buffer);
oapiWriteLine(scn,buffer);
pointer->getsaveline(buffer);
oapiWriteLine(scn,buffer);
pointer=static_cast<MFDvariable*>(iterator->next());
}
strcpy(buffer,"Finvars");
oapiWriteLine(scn,buffer);
delete iterator;
}
bool MFDvarhandler::loadallvariables(FILEHANDLE scn)
{
PARSER parser;
char *buffer,*member;
char namebuffer[20];
int length,tadjmode;
MFDvariable *pointer;
XPtr<dblliter> iterator=listhead.getiterator();
pointer=static_cast<MFDvariable*>(iterator->front());
while (pointer!=NULL)
{
if (!oapiReadScenario_nextline(scn,buffer)) return false;
pointer->getname(namebuffer);
if (strcmp(buffer,namebuffer)==0)
{
//Name matches
if (!oapiReadScenario_nextline(scn,buffer)) return false;//Unexpected end
parser.parseline(buffer);
if (!parser.getlineelement(0,&member,&length)) return false;//No required element
sscanf(member,"%i",&tadjmode);
pointer->setadjmode(tadjmode);//Set the adjustment mode
if (!parser.getlineelement(1,&member,&length)) return false;//No required element
pointer->loadvalue(member);//Set the variable to the saved value
}
else
{
//No match
if (strcmp(buffer,"Finvars")==0) return true;//Somehow reached end of section - return anyway
}
pointer=static_cast<MFDvariable*>(iterator->next());
}
//Now finished variables, look for the end label
do
{
if (!oapiReadScenario_nextline(scn,buffer)) return false;
}
while (strcmp(buffer,"Finvars")!=0);
return true;
}
MFDvarhandler::MFDvarhandler()
{
for (int a=0;a<5;a++)currvariable[a]=0;
listhead.empty();
variterator=listhead.getiterator();
variterator->front();
}
MFDvarhandler::~MFDvarhandler()
{
listhead.empty();
delete variterator;
}
void MFDvarhandler::setnextcurrent(int viewmode)
{
if (viewmode<0 || viewmode>4) viewmode=0;
currviewmode=viewmode;
MFDvariable *startpos;
startpos=static_cast<MFDvariable*>(variterator->next());
if (startpos==NULL) startpos=static_cast<MFDvariable*>(variterator->front());
if (startpos==NULL) return;
current=startpos;
do
{
if (current!=NULL)
{
if ((current->viewmode1==viewmode || current->viewmode2==viewmode)&¤t->showvariable)
{
currvariable[viewmode]=current;
return;
}
}
current=static_cast<MFDvariable*>(variterator->next());
}
while (startpos!=current);//causes termination if no legal outcome
currvariable[viewmode]=current;
return;
}
bool MFDvarhandler::crosscopy(MFDvarhandler &othervars)
{
dblliter *iterator=listhead.getiterator();
dblliter *remoteiterator=othervars.listhead.getiterator();
MFDvariable *current=static_cast<MFDvariable*>(iterator->front());
MFDvariable *remotecurrent=static_cast<MFDvariable*>(remoteiterator->front());
while (current!=NULL)
{
current->setall(remotecurrent);
current=static_cast<MFDvariable*>(iterator->next());
remotecurrent=static_cast<MFDvariable*>(remoteiterator->next());
}
delete iterator;
delete remoteiterator;
return true;
}
void MFDvarhandler::setprevcurrent(int viewmode)
{
if (viewmode<0 || viewmode>4) viewmode=0;
currviewmode=viewmode;
MFDvariable *startpos;
startpos=static_cast<MFDvariable*>(variterator->previous());
if (startpos==NULL) startpos=static_cast<MFDvariable*>(variterator->back());
if (startpos==NULL) return;
current=startpos;
do
{
if (current!=NULL)
{
if ((current->viewmode1==viewmode || current->viewmode2==viewmode)&¤t->showvariable)
{
currvariable[viewmode]=current;
return;
}
}
current=static_cast<MFDvariable*>(variterator->previous());
}
while (startpos!=current);//causes termination if no legal outcome
currvariable[viewmode]=current;
return;
}
MFDvariable* MFDvarhandler::getcurrent(int viewmode)
{
if (viewmode==currviewmode) return static_cast<MFDvariable*>(variterator->current());
current=currvariable[viewmode];
current=static_cast<MFDvariable*>(listhead.isinlist(current));
if (current==NULL)
{
setnextcurrent(viewmode);
}
return current;
}
| [
"steve@5a6c10e1-6920-0410-8c7b-9669c677a970"
] | [
[
[
1,
202
]
]
] |
093100761874dd56060936445b8224d36086d046 | 64e71842175f9130c622420f69ff24c515ceeeb3 | /hysteresismain.cpp | 374be25e8bc16664abc601dfd11efd6f775d7027 | [] | no_license | rydotyosh/hysteresisvst | 5fbe05d020a04ea4d03264ac5a01933567f2d020 | d28c88c2eb4c8c09f23e4f21e6f1e30dfb2c6ea1 | refs/heads/master | 2020-06-02T07:46:43.919074 | 2008-08-10T04:15:02 | 2008-08-10T04:15:02 | 32,113,513 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,048 | cpp | //-------------------------------------------------------------------------------------------------------
// VST Plug-In
// Version 2.4 $Date: 2006/11/13 09:08:27 $
//
// Category : VST filter
// Filename : hysteresismain.cpp
// Created by : Ryogo Yoshimura
// Description : Hysteresis filter
//
// (c) Ryogo Yoshimura, All Rights Reserved
// MIT License
//-------------------------------------------------------------------------------------------------------
#include "hysteresis.h"
#ifdef _DEBUG
#pragma comment(lib,"vstbased.lib")
#else
#pragma comment(lib,"vstbase.lib")
#endif
//-------------------------------------------------------------------------------------------------------
AudioEffect* createEffectInstance (audioMasterCallback audioMaster)
{
return new Hysteresis (audioMaster);
}
#if WIN32
#include <windows.h>
void* hInstance;
extern "C" {
BOOL WINAPI DllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpvReserved)
{
hInstance = hInst;
return 1;
}
} // extern "C"
#endif
| [
"Ryogo.Yoshimura@d8770963-c053-0410-a7e7-098f70d26b45"
] | [
[
[
1,
39
]
]
] |
4e3b2b3172f27c03c1f048607d5e84e4c037b2c2 | 27c6eed99799f8398fe4c30df2088f30ae317aff | /rtt-tool/qdoc3/uncompressor.cpp | 425f001baa2f01659a1fcc2d7f9c5faafe0ac27b | [] | no_license | lit-uriy/ysoft | ae67cd174861e610f7e1519236e94ffb4d350249 | 6c3f077ff00c8332b162b4e82229879475fc8f97 | refs/heads/master | 2021-01-10T08:16:45.115964 | 2009-07-16T00:27:01 | 2009-07-16T00:27:01 | 51,699,806 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,820 | cpp | /****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information ([email protected])
**
** This file is part of the tools applications of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain
** additional rights. These rights are described in the Nokia Qt LGPL
** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
** package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at [email protected].
** $QT_END_LICENSE$
**
****************************************************************************/
/*
uncompressor.cpp
*/
#include "uncompressor.h"
QT_BEGIN_NAMESPACE
QList<Uncompressor *> Uncompressor::uncompressors;
/*!
\class Uncompressor
\brief The Uncompressor class is a base class for classes that
know how to uncompress a certain kind of compressed file.
The uncompressor contains a list of the filename extensions
of the file types that the uncompressor knows how to uncompress.
It maintains a static list of all the instances of Uncompressor
that have been created. It also has a static function for searching
that list to find the uncompressor to use for uncompressing a file
with a certain extension.
*/
/*!
The constructor takes a list of filename extensions, which it
copies and saves internally. This uncompressor is prepended
to the stack list.
*/
Uncompressor::Uncompressor( const QStringList& extensions )
: fileExts( extensions )
{
uncompressors.prepend( this );
}
/*!
The destructor deletes all the filename extensions.
*/
Uncompressor::~Uncompressor()
{
uncompressors.removeAll( this );
}
/*!
This function searches the static list of uncompressors to find the
first one that can handle \a fileName. If it finds an acceptable
uncompressor, it returns a pointer to it. Otherwise it returns null.
*/
Uncompressor*
Uncompressor::uncompressorForFileName( const QString& fileName )
{
int dot = -1;
while ( (dot = fileName.indexOf(".", dot + 1)) != -1 ) {
QString ext = fileName.mid( dot + 1 );
QList<Uncompressor *>::ConstIterator u = uncompressors.begin();
while ( u != uncompressors.end() ) {
if ( (*u)->fileExtensions().contains(ext) )
return *u;
++u;
}
}
return 0;
}
QT_END_NAMESPACE
| [
"lit-uriy@d7ba3245-3e7b-42d0-9cd4-356c8b94b330"
] | [
[
[
1,
108
]
]
] |
6b2e6c4f3601bcaffe9c65c5934acbf6c67a71e9 | fb135677f176035a63927d5e307986d27205a6ab | /bitwise-engine/Graphics/Color.h | 6b456abed3e94ff441e4225473643d10aa281a85 | [] | no_license | jaylindquist/bitwise-engine | eb7c6991a18db22430a8c38c45cfb5c3de3ed936 | c8be0cb946fff4523b6a42dbe014f6a204afdedb | refs/heads/master | 2016-09-06T06:45:51.390789 | 2008-11-19T23:24:52 | 2008-11-19T23:24:52 | 35,298,714 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 701 | h | #pragma once
#include <BitwiseEngine/Math/Real.h>
namespace BitwiseEngine {
namespace Graphics {
class Color
{
public:
BitwiseEngine::Math::Real r;
BitwiseEngine::Math::Real g;
BitwiseEngine::Math::Real b;
BitwiseEngine::Math::Real a;
static Color WHITE;
static Color BLACK;
static Color RED;
static Color GREEN;
static Color BLUE;
static Color CYAN;
static Color MAGENTA;
static Color YELLOW;
Color();
Color(BitwiseEngine::Math::Real red, BitwiseEngine::Math::Real green, BitwiseEngine::Math::Real blue);
Color(BitwiseEngine::Math::Real red, BitwiseEngine::Math::Real green, BitwiseEngine::Math::Real blue, BitwiseEngine::Math::Real alpha);
};
};
}; | [
"yasunobu13@194bc0c5-1251-0410-adcc-b97d8ca696f6"
] | [
[
[
1,
31
]
]
] |
2ea078ef00892a19281b8d64ad081a82cec3bdb7 | 9176b0fd29516d34cfd0b143e1c5c0f9e665c0ed | /CS_153_Data_Structures/assignment9/jra79813496/exception.cpp | 0fdc44037aad805bfda5d139227264d5b2d94ab1 | [] | no_license | Mr-Anderson/james_mst_hw | 70dbde80838e299f9fa9c5fcc16f4a41eec8263a | 83db5f100c56e5bb72fe34d994c83a669218c962 | refs/heads/master | 2020-05-04T13:15:25.694979 | 2011-11-30T20:10:15 | 2011-11-30T20:10:15 | 2,639,602 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 597 | cpp | //////////////////////////////////////////////////////////////////////
/// @file exception.cpp
/// @author James Anderson Section A
/// @brief Implementation file for exception class for assignment 1
//////////////////////////////////////////////////////////////////////
#include "exception.h"
Exception::Exception (Error_Type _error_code, string _error_message)
{
m_error_code = _error_code;
m_error_message = _error_message;
}
Error_Type Exception::error_code ()
{
return m_error_code;
}
string Exception::error_message ()
{
return m_error_message;
}
| [
"[email protected]"
] | [
[
[
1,
22
]
]
] |
f217d0b78039d0fcce67f0368a123609caae5f89 | 611fc0940b78862ca89de79a8bbeab991f5f471a | /src/Teki/Boss/Queen/FriendObjects/Hibi.h | db4a814386de6d72bdbfaacb8e1d43fb3149bece | [] | no_license | LakeIshikawa/splstage2 | df1d8f59319a4e8d9375b9d3379c3548bc520f44 | b4bf7caadf940773a977edd0de8edc610cd2f736 | refs/heads/master | 2021-01-10T21:16:45.430981 | 2010-01-29T08:57:34 | 2010-01-29T08:57:34 | 37,068,575 | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 1,132 | h | #include <string>
#include <vector>
#include <exception>
using namespace std;
#pragma once
#include "..\\..\\..\\..\\Mob\\Movable.h"
#include "..\\..\\..\\..\\Management\\GameControl.h"
//! 罅
/****************************************************************//**
* ヒビ
* \nosubgrouping
********************************************************************/
class Hibi : public Movable
{
public:
//! 標準コンストラクタ
Hibi(IPositionable* parent): mParent(parent)
{
mHibiStage = 0;
mZ = -0.1;
}
//! @see Movable
void Move(){
if( mHibiStage ){
int x = mParent->GetX();
int y = mParent->GetY();
int left = (mHibiStage-1)*mParent->GetFrameSizeX();
int top = 0;
int right = mHibiStage*mParent->GetFrameSizeX();
int bottom = mParent->GetFrameSizeY();
DX_DRAW( "graphics\\teki\\queen\\boss4_mirror0.png",
x, y, left, top, right, bottom );
}
}
//! @see Movable
void RunTask(){}
//! ヒビの強さを設定する(0->3)
void SetHibiStage(int st){ mHibiStage = st; }
private:
int mHibiStage;
IPositionable* mParent;
};
| [
"lakeishikawa@c9935178-01ba-11df-8f7b-bfe16de6f99b"
] | [
[
[
1,
50
]
]
] |
7d6fc276c8adbced4aadab25c49a632c775e0209 | 8a8873b129313b24341e8fa88a49052e09c3fa51 | /inc/SearchResultOutView.h | c8791df435b97ece9de9b11de869c27151bef23b | [] | no_license | flaithbheartaigh/wapbrowser | ba09f7aa981d65df810dba2156a3f153df071dcf | b0d93ce8517916d23104be608548e93740bace4e | refs/heads/master | 2021-01-10T11:29:49.555342 | 2010-03-08T09:36:03 | 2010-03-08T09:36:03 | 50,261,329 | 1 | 0 | null | null | null | null | GB18030 | C++ | false | false | 3,357 | h | /*
============================================================================
Name : SearchResultOutView.h
Author :
Version :
Copyright : Your copyright notice
Description : CSearchResultOutView declaration
============================================================================
*/
#ifndef SEARCHRESULTOUTVIEW_H
#define SEARCHRESULTOUTVIEW_H
// INCLUDES
#include <eikedwin.h>
#include "Window.h"
#include "PopUpMenuObserver.h"
#include "MControlObserver.h"
#include "DialogObserver.h"
#include "MControlObserver.h"
#include "NotifyTimer.h"
// CLASS DECLARATION
class CMainEngine;
class CHandleOutSearch;
class CDialog;
class CInputDialog;
class CLinkListBox;
class CTitleBar;
// CLASS DECLARATION
/**
* CSearchResultOutView
*
*/
class CSearchResultOutView : public CWindow , public MTimerNotifier,public MPopUpMenuObserver,public MHandleEventObserver,public MDialogObserver,public MInputObserver,public MLinkListObserver
{
public: // Constructors and destructor
~CSearchResultOutView();
static CSearchResultOutView* NewL(CWindow* aParent,CMainEngine& aMainEngine,TInt aIndex,const TDesC8& aURL,const TDesC& aTitle);
static CSearchResultOutView* NewLC(CWindow* aParent,CMainEngine& aMainEngine,TInt aIndex,const TDesC8& aURL,const TDesC& aTitle);
private:
CSearchResultOutView(CWindow* aParent,CMainEngine& aMainEngine,TInt aIndex);
void ConstructL(const TDesC8& aURL,const TDesC& aTitle);
public://From Dialog
virtual void DialogEvent(TInt aCommand);
public://From CWindow
//派生类实现激活视图
virtual void DoActivateL();
//派生类实现冻结视图
virtual void DoDeactivate();
//派生类实现绘图
virtual void DoDraw(CGraphic& aGraphic)const;
//派生类实现按键事件响应
virtual TBool DoKeyEventL(TInt aKeyCode);
//派生类实现命令事件响应
virtual TBool DoHandleCommandL(TInt aCommand);
//派生类实现界面尺寸改变
virtual void DoSizeChanged();
//派生类实现设置左右按钮,以便覆盖按钮的控件返回时回复原样
virtual void ChangeButton();
public:// From MInputObserver
virtual void InputResponseEvent(TInt aEvent,const TDesC& aText);
public://From MPopUpMenuObserver
virtual void DoPopUpMenuCommand(TInt aCommand);
public://From MHandleEventObserver
virtual void HandleResponseEvent(TInt aEvent,TInt aType);
public:
virtual void LinkListEvent(TInt aEvent,TInt aType);
public://From MTimerNotifier
virtual TBool DoPeriodTask();
private:
void InitEdwin();
void InitWaitDialog(const TDesC& aText);
void InitDialog(const TDesC& aText);
void InitPopUpMenu();
void InitInputDialog();
void InitListBox();
void StartSearch();
const TDesC8& GetUrlEncode(const TDesC& aText);
void SetEdwinVisible(TBool aBool);
void DoOKKey();
void DrawEditor(CGraphic& gc) const;
private:
CNotifyTimer* iTimer;
CEikEdwin* iEdwin;
CInputDialog* iInputDialog;
CTitleBar* iTitleBar;
CDialog* iDialog;
CHandleOutSearch* iOutSearch;
CLinkListBox* iLinkList;
CMainEngine& iMainEngine;
TInt iIndex;
HBufC* iTitle;
HBufC8* iUrl;
HBufC8* iTempBuf;
TBuf<20> iKeyWord;
TBool iFlag;
TInt iCurPage;
TInt iAllPage;
TInt iPopState;
TPoint iPoint;
TInt iDownLoadFlag;
};
#endif // SEARCHRESULTOUTVIEW_H
| [
"sungrass.xp@37a08ede-ebbd-11dd-bd7b-b12b6590754f"
] | [
[
[
1,
120
]
]
] |
ce6f27c44ede94dd6adb8aa4c0c9eef6819117fc | 335783c9e5837a1b626073d1288b492f9f6b057f | /source/fbxcmd/daolib/Model/PHY/SHAP.cpp | 3405a9361164788b778aaad0cf3bc1081b277fc8 | [
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-2-Clause"
] | permissive | code-google-com/fbx4eclipse | 110766ee9760029d5017536847e9f3dc09e6ebd2 | cc494db4261d7d636f8c4d0313db3953b781e295 | refs/heads/master | 2016-09-08T01:55:57.195874 | 2009-12-03T20:35:48 | 2009-12-03T20:35:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,674 | cpp |
/**********************************************************************
*<
FILE: SHAP.h
DESCRIPTION: PHY File Format
HISTORY:
*> Copyright (c) 2009, All Rights Reserved.
**********************************************************************/
#include <stdafx.h>
#include "GFF/GFFCommon.h"
#include "GFF/GFFField.h"
#include "GFF/GFFList.h"
#include "GFF/GFFStruct.h"
#include "PHY/PHYCommon.h"
#include "PHY/SHAP.h"
using namespace std;
using namespace DAO;
using namespace DAO::GFF;
using namespace DAO::PHY;
///////////////////////////////////////////////////////////////////
ShortString SHAP::type("SHAP");SHAP::SHAP(GFFStructRef owner) : impl(owner) {
}
unsigned long SHAP::get_shapeType() const {
return impl->GetField(GFF_MMH_SHAPE_TYPE)->asUInt32();
}
void SHAP::set_shapeType(unsigned long value) {
impl->GetField(GFF_MMH_SHAPE_TYPE)->assign(value);
}
Text SHAP::get_shapePmatName() const {
return impl->GetField(GFF_MMH_SHAPE_PMAT_NAME)->asECString();
}
void SHAP::set_shapePmatName(const Text& value) {
impl->GetField(GFF_MMH_SHAPE_PMAT_NAME)->assign(value);
}
Quaternion SHAP::get_shapeRotation() const {
return impl->GetField(GFF_MMH_SHAPE_ROTATION)->asQuat();
}
void SHAP::set_shapeRotation(Quaternion value) {
impl->GetField(GFF_MMH_SHAPE_ROTATION)->assign(value);
}
Vector4f SHAP::get_shapePosition() const {
return impl->GetField(GFF_MMH_SHAPE_POSITION)->asVector4f();
}
void SHAP::set_shapePosition(Vector4f value) {
impl->GetField(GFF_MMH_SHAPE_POSITION)->assign(value);
}
unsigned char SHAP::get_shapeCollisionMaskAll() const {
return impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_ALL)->asUInt8();
}
void SHAP::set_shapeCollisionMaskAll(unsigned char value) {
impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_ALL)->assign(value);
}
unsigned char SHAP::get_shapeCollisionMaskNone() const {
return impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_NONE)->asUInt8();
}
void SHAP::set_shapeCollisionMaskNone(unsigned char value) {
impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_NONE)->assign(value);
}
unsigned char SHAP::get_shapeCollisionMaskItems() const {
return impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_ITEMS)->asUInt8();
}
void SHAP::set_shapeCollisionMaskItems(unsigned char value) {
impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_ITEMS)->assign(value);
}
unsigned char SHAP::get_shapeCollisionMaskCreatures() const {
return impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_CREATURES)->asUInt8();
}
void SHAP::set_shapeCollisionMaskCreatures(unsigned char value) {
impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_CREATURES)->assign(value);
}
unsigned char SHAP::get_shapeCollisionMaskPlaceables() const {
return impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_PLACEABLES)->asUInt8();
}
void SHAP::set_shapeCollisionMaskPlaceables(unsigned char value) {
impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_PLACEABLES)->assign(value);
}
unsigned char SHAP::get_shapeCollisionMaskTriggers() const {
return impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_TRIGGERS)->asUInt8();
}
void SHAP::set_shapeCollisionMaskTriggers(unsigned char value) {
impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_TRIGGERS)->assign(value);
}
unsigned char SHAP::get_shapeCollisionMaskStaticGeometry() const {
return impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_STATIC_GEOMETRY)->asUInt8();
}
void SHAP::set_shapeCollisionMaskStaticGeometry(unsigned char value) {
impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_STATIC_GEOMETRY)->assign(value);
}
unsigned char SHAP::get_shapeCollisionMaskNonwalkable() const {
return impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_NONWALKABLE)->asUInt8();
}
void SHAP::set_shapeCollisionMaskNonwalkable(unsigned char value) {
impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_NONWALKABLE)->assign(value);
}
unsigned char SHAP::get_shapeCollisionMaskEffects() const {
return impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_EFFECTS)->asUInt8();
}
void SHAP::set_shapeCollisionMaskEffects(unsigned char value) {
impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_EFFECTS)->assign(value);
}
unsigned char SHAP::get_shapeCollisionMaskWaypoints() const {
return impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_WAYPOINTS)->asUInt8();
}
void SHAP::set_shapeCollisionMaskWaypoints(unsigned char value) {
impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_WAYPOINTS)->assign(value);
}
float SHAP::get_shapeVolume() const {
return impl->GetField(GFF_MMH_SHAPE_VOLUME)->asFloat32();
}
void SHAP::set_shapeVolume(float value) {
impl->GetField(GFF_MMH_SHAPE_VOLUME)->assign(value);
}
Text SHAP::get_shapeName() const {
return impl->GetField(GFF_MMH_SHAPE_NAME)->asECString();
}
void SHAP::set_shapeName(const Text& value) {
impl->GetField(GFF_MMH_SHAPE_NAME)->assign(value);
}
unsigned char SHAP::get_shapeAllowEmitterSpawn() const {
return impl->GetField(GFF_MMH_SHAPE_ALLOW_EMITTER_SPAWN)->asUInt8();
}
void SHAP::set_shapeAllowEmitterSpawn(unsigned char value) {
impl->GetField(GFF_MMH_SHAPE_ALLOW_EMITTER_SPAWN)->assign(value);
}
unsigned long SHAP::get_collisionGroup() const {
return impl->GetField(GFF_MMH_COLLISION_GROUP)->asUInt32();
}
void SHAP::set_collisionGroup(unsigned long value) {
impl->GetField(GFF_MMH_COLLISION_GROUP)->assign(value);
}
unsigned char SHAP::get_shapeFadeable() const {
return impl->GetField(GFF_MMH_SHAPE_FADEABLE)->asUInt8();
}
void SHAP::set_shapeFadeable(unsigned char value) {
impl->GetField(GFF_MMH_SHAPE_FADEABLE)->assign(value);
}
unsigned char SHAP::get_shapeCollisionMaskWater() const {
return impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_WATER)->asUInt8();
}
void SHAP::set_shapeCollisionMaskWater(unsigned char value) {
impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_WATER)->assign(value);
}
unsigned char SHAP::get_shapeCollisionMaskTerrainWall() const {
return impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_TERRAIN_WALL)->asUInt8();
}
void SHAP::set_shapeCollisionMaskTerrainWall(unsigned char value) {
impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_TERRAIN_WALL)->assign(value);
}
unsigned char SHAP::get_shapeCollisionMaskWalkable() const {
return impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_WALKABLE)->asUInt8();
}
void SHAP::set_shapeCollisionMaskWalkable(unsigned char value) {
impl->GetField(GFF_MMH_SHAPE_COLLISION_MASK_WALKABLE)->assign(value);
}
GFFFieldRef SHAP::get_shapeTypeStruct() const {
return impl->GetField(GFF_MMH_SHAPE_TYPE_STRUCT);
}
GFFListRef SHAP::get_children() const {
return impl->GetField(GFF_MMH_CHILDREN)->asList();
}
| [
"tazpn314@ccf8930c-dfc1-11de-9043-17b7bd24f792"
] | [
[
[
1,
210
]
]
] |
160c82038db22c1fc5ab29c8e80b422105db6e41 | fcf03ead74f6dc103ec3b07ffe3bce81c820660d | /Basics/StaticDLL/CreateStaticDLL.cpp | c435dfc9a00bdedd87d124e69d7d606a19e29d4b | [] | no_license | huellif/symbian-example | 72097c9aec6d45d555a79a30d576dddc04a65a16 | 56f6c5e67a3d37961408fc51188d46d49bddcfdc | refs/heads/master | 2016-09-06T12:49:32.021854 | 2010-10-14T06:31:20 | 2010-10-14T06:31:20 | 38,062,421 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,043 | cpp | // CreateStaticDLL.cpp
//
// Copyright (c) 2000-2005 Symbian Software Ltd. All rights reserved.
// This program creates a dll.
#include "CreateStaticDLL.h"
#include <e32uid.h>
// construct/destruct
EXPORT_C CMessenger* CMessenger::NewLC(CConsoleBase& aConsole, const TDesC& aString)
{
CMessenger* self=new (ELeave) CMessenger(aConsole);
CleanupStack::PushL(self);
self->ConstructL(aString);
return self;
}
CMessenger::~CMessenger() // destruct - virtual, so no export
{
delete iString;
}
EXPORT_C void CMessenger::ShowMessage()
{
_LIT(KFormat1,"%S\n");
iConsole.Printf(KFormat1, iString); // notify completion
}
// constructor support
// don't export these, because used only by functions in this DLL, eg our NewLC()
CMessenger::CMessenger(CConsoleBase& aConsole) // first-phase C++ constructor
: iConsole(aConsole)
{
}
void CMessenger::ConstructL(const TDesC& aString) // second-phase constructor
{
iString=aString.AllocL(); // copy given string into own descriptor
}
| [
"liuxk99@bdc341c6-17c0-11de-ac9f-1d9250355bca"
] | [
[
[
1,
42
]
]
] |
b00ed2ab3a5b675afb039f1530740d721b974e57 | 867f5533667cce30d0743d5bea6b0c083c073386 | /jingxian-network/src/jingxian/networks/commands/WriteCommand.cpp | 26875c65e2fbe0b825f0ac047b3af378386d9502 | [] | no_license | mei-rune/jingxian-project | 32804e0fa82f3f9a38f79e9a99c4645b9256e889 | 47bc7a2cb51fa0d85279f46207f6d7bea57f9e19 | refs/heads/master | 2022-08-12T18:43:37.139637 | 2009-12-11T09:30:04 | 2009-12-11T09:30:04 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,535 | cpp |
# include "pro_config.h"
# include "jingxian/networks/commands/WriteCommand.h"
_jingxian_begin
WriteCommand::WriteCommand(ConnectedSocket* transport)
: transport_(transport)
{
}
WriteCommand::~WriteCommand()
{
}
std::vector<io_mem_buf>& WriteCommand::iovec()
{
return iovec_;
}
void WriteCommand::on_complete(size_t bytes_transferred,
bool success,
void *completion_key,
errcode_t error)
{
if (!success)
{
tstring err = ::concat<tstring>(_T("写数据时发生错误 - "), lastError(error));
transport_->onError(*this, transport_mode::Send, error, err);
return;
}
else if (0 == bytes_transferred)
{
transport_->onError(*this, transport_mode::Send, error, _T("对方主动关闭!"));
return;
}
else
{
transport_->onWrite(*this, bytes_transferred);
}
}
bool WriteCommand::execute()
{
DWORD bytesTransferred;
if (SOCKET_ERROR != ::WSASend(transport_->handle()
, &(iovec_[0])
, (DWORD)iovec_.size()
, &bytesTransferred
, 0
, this
, NULL))
return true;
if (WSA_IO_PENDING == ::WSAGetLastError())
return true;
return false;
}
_jingxian_end
| [
"runner.mei@0dd8077a-353d-11de-b438-597f59cd7555"
] | [
[
[
1,
60
]
]
] |
213233a722c19631691758c0aaf1e70cf2be77fb | 52dd8bdffaa5d7e450477b7f3955dbe0d26b7473 | /sort/seqlist-sort/seqlist.cpp | 502d8b67de2c5ef9148b5918550a50c8765927f1 | [] | no_license | xhbang/algorithms | 7475a4f3ed1a6877a0950eb3534edaeb2a6921a1 | 226229bc77e2926246617aa4a9db308096183a8c | refs/heads/master | 2021-01-25T04:57:53.425634 | 2011-12-05T09:57:09 | 2011-12-05T09:57:09 | 2,352,910 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,650 | cpp | #include <iostream>
using namespace std;
//typedef int DataType
const int maxsize=100;
template <typename T>
class SeqList{
private:
T data[maxsize];
int size;
public:
void init();
int insert(int pos,T item);
int length();
int deleteat(int pos);
T get_item(int pos);
int locate(T item);
};
template <typename T>
void SeqList<T>::init(){
size=0;
}
template <typename T>
int SeqList<T>::insert(int pos,T item){
if(pos<1 || pos >(size+1))
return 0;
if(size>=maxsize)
return 0;
for(int i=size;i>=pos;i--)
data[i]=data[i-1];
data[pos-1]=item;
size++;
return 1;
}
template <typename T>
int SeqList<T>::length(){
return size;
}
template <typename T>
int SeqList<T>::deleteat(int pos){
if(pos<1 || pos >size){
cout<<"A WRONG RANGE OF DATA"<<endl;
return 0;
}
for(int i=pos;i<size;i++)
data[i-1]=data[i];
size--;
return 1;
}
template <typename T>
T SeqList<T>::get_item(int pos){
if(pos<1 || pos >size){
cout<<"A WRONG RANGE OF DATA"<<endl;
}
return data[pos-1];
}
template <typename T>
int SeqList<T>::locate(T item){
int found=0,i=0;
while(i<size && !found){
if(data[i]==item)
found=1;
else i++;
}
if(i<size)
return i+1;
else
return -1;
}
//for test
int main(){
SeqList<int> clist;
clist.init();
for(int i=0;i<7;i++)
clist.insert(1,i);
for(i=0;i<clist.length();i++)
cout<<clist.get_item(i+1)<<endl;
clist.deleteat(4);
for(i=0;i<clist.length();i++)
cout<<clist.get_item(i+1)<<endl;
cout<<"cin a char to find"<<endl;
int ch;
cin>>ch;
cout<<clist.locate(ch)<<endl;
return 0;
}
| [
"[email protected]"
] | [
[
[
1,
98
]
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.